*** Replication Do-File for BJPS Paper 'A New Dilemma of Social Democracy?' (19/09/23) - All Tables and Figures in Main Text and Supplementary Appendix Bar Figures 1, 2, and Appendix 4 and 24 (see other do-files).

*** Pre-Clean Version

***********************************************************************************

version 14
clear all
set more off, perm
set scrollbufsize 300000
set maxvar 32767

use "C:\Users\Zack.Grant\Dropbox (Nuffield College)\PROJECTS\IDENTITYPOL-GB\New Dilemma of Social Democracy Paper\Data\BES2019_W21_Panel_v21.0.dta", clear //* BESIP Panel, Combined Wave 1-21 Internet Panel (2021 Release) - Later editions should also work fine 


** RECODING DATA **


*** Occupational Class

* Wave 10
svyset [pweight= wt_new_W10], psu(id)

gen objectiveclassW10 =.
label define objectiveclassW10 1 "Old Middle Class" 2 "New Middle Class" 3 "Intermediate Class" 4 "Own Account" 5 "Foremen + Supervisors" 6 "Working Class" 7 "Other Outside Labour Force", replace
label variable objectiveclassW10 "Respondent Occupational Class"
label values objectiveclassW10 objectiveclassW10

replace objectiveclassW10 = 1 if inlist(ns_secW6W7W8W9,10,20,33,34,43,50,81,82,92)   //* OMC  (Employers, Managers, Administrators, Farmers, and Professionals Self-Employed, e.g. lawyers, doctors, psychologists, senior officers in police/NHS etc.)
replace objectiveclassW10 = 2 if inlist(ns_secW6W7W8W9,31,32,41,42,60) //* NMC  (Professional Employees + Higher Supervisors [e.g. office supervisors], e.g. web designers, nurses, teachers, social workers, scientists, engineers, physios)        
replace objectiveclassW10 = 3 if inlist(ns_secW6W7W8W9,71,72,73,74) //* Intermediate Classes (Lower white collar employees, Clerks, Call centre workers, sales teams, junior admin staff - i.e. classW19ic office workers - techies, IT staff, police etc)
replace objectiveclassW10 = 4 if inlist(ns_secW6W7W8W9,44,91) //* Own Account (importers and exporters, self employed tradespeople)
replace objectiveclassW10 = 5 if inlist(ns_secW6W7W8W9,100)  //* Foremen and Lower Supervisors
replace objectiveclassW10 = 6 if inrange(ns_secW6W7W8W9,111,135)  //* WC = Non-supervisory lower technical, semi-routine, and routine employees (e.g. metal workers, shelf fillers, security workers, porters, waiters, cleaners, drivers, telephone salespeople, checkout workers, employed hairdressers, care workers, scaffolders, cooks, employed craftspeople, childcare workers)

replace objectiveclassW10 = 1 if inrange(selfNumEmployeesW6_W12,1,9999)                          //* Assign employers to top category

replace objectiveclassW10 = 1 if selfOccStatusW6_W12 == 0 & inlist(objectiveclassW10,2)          //* Assign self-employed professionals to top category
replace objectiveclassW10 = 1 if selfOccStatusLastW6_W12 == 0 & inlist(objectiveclassW10,2)          //* Assign self-employed professionals to top category

replace objectiveclassW10 = 4 if selfOccStatusW6_W12 == 0 & inlist(objectiveclassW10,3,4,5,6,7)  //* Assign lower self-employed to own account
replace objectiveclassW10 = 4 if selfOccStatusLastW6_W12 == 0 & inlist(objectiveclassW10,3,4,5,6,7)  //* Assign lower self-employed to own account

replace objectiveclassW10 = 7 if ns_secW6W7W8W9 ==. & inlist(workingStatusW6_W12,4,5,6,7,8)      //* Assign missing to out of labour market 


* Wave 19

gen objectiveclassW19 =.
label define objectiveclassW19 1 "Old Middle Class" 2 "New Middle Class" 3 "Intermediate Class" 4 "Own Account" 5 "Foremen + Supervisors" 6 "Working Class" 7 "Other Outside Labour Force", replace
label variable objectiveclassW19 "Respondent Occupational Class"
label values objectiveclassW19 objectiveclassW19

replace objectiveclassW19 = 1 if inlist(ns_secW19,10,20,33,34,43,50,81,82,92) 
replace objectiveclassW19 = 2 if inlist(ns_secW19,31,32,41,42,60)   
replace objectiveclassW19 = 3 if inlist(ns_secW19,71,72,73,74) 
replace objectiveclassW19 = 4 if inlist(ns_secW19,44,91) 
replace objectiveclassW19 = 5 if inlist(ns_secW19,100)  
replace objectiveclassW19 = 6 if inrange(ns_secW19,111,135) 

replace objectiveclassW19 = 1 if inrange(selfNumEmployeesLastW19,1,9999) //* Assign employers to top category

replace objectiveclassW19 = 1 if selfOccStatusW19 == 0 & inlist(objectiveclassW19,2) //* Assign self-employed professionals to top category
replace objectiveclassW19 = 1 if selfOccStatusLastW19 == 0 & inlist(objectiveclassW19,2)

replace objectiveclassW19 = 4 if selfOccStatusW19 == 0 & inlist(objectiveclassW19,3,4,5,6,7)  //* Assign lower self-employed to own account
replace objectiveclassW19 = 4 if selfOccStatusLastW19 == 0 & inlist(objectiveclassW19,3,4,5,6,7)

replace objectiveclassW19 = 7 if ns_secW19 ==. & inlist(workingStatusW19,4,5,6,7,8) //* Assign those without social class information to an additional category


* Wave 21

gen objectiveclassW21 =.
label define objectiveclassW21 1 "Old Middle Class" 2 "New Middle Class" 3 "Intermediate Class" 4 "Own Account" 5 "Foremen + Supervisors" 6 "Working Class" 7 "Other Outside Labour Force", replace
label variable objectiveclassW21 "Respondent Occupational Class"
label values objectiveclassW21 objectiveclassW21

replace objectiveclassW21 = 1 if inlist(ns_secW21,10,20,33,34,43,50,81,82,92) 
replace objectiveclassW21 = 2 if inlist(ns_secW21,31,32,41,42,60)   
replace objectiveclassW21 = 3 if inlist(ns_secW21,71,72,73,74) 
replace objectiveclassW21 = 4 if inlist(ns_secW21,44,91) 
replace objectiveclassW21 = 5 if inlist(ns_secW21,100)  
replace objectiveclassW21 = 6 if inrange(ns_secW21,111,135) 

replace objectiveclassW21 = 1 if inrange(selfNumEmployeesLastW21,1,9999) //* Assign employers to top category

replace objectiveclassW21 = 1 if selfOccStatusW21 == 0 & inlist(objectiveclassW21,2) //* Assign self-employed professionals to top category
replace objectiveclassW21 = 1 if selfOccStatusLastW21 == 0 & inlist(objectiveclassW21,2)

replace objectiveclassW21 = 4 if selfOccStatusW21 == 0 & inlist(objectiveclassW21,3,4,5,6,7)  //* Assign lower self-employed to own account
replace objectiveclassW21 = 4 if selfOccStatusLastW21 == 0 & inlist(objectiveclassW21,3,4,5,6,7)

replace objectiveclassW21 = 7 if ns_secW21 ==. & inlist(workingStatusW21,4,5,6,7,8) //* Assign those without social class information to an additional category





* Education

* Wave 10
gen degreeW10 =.
label define degreeW10 1 "University Degree or at Uni now" 0 "No University Degree"
label var    degreeW10   "Dummy: Has a University Degree or Equivalent, or is Currently at Uni"
label values degreeW10 degreeW10
replace degreeW10 = 1 if inlist(p_educationW10,13,14,15,16,17)
replace degreeW10 = 0 if degreeW10 != 1 & p_educationW10 !=. & p_educationW10 != 20

* Wave 19
gen degreeW19 =.
label define degreeW19 1 "University Degree or at Uni now" 0 "No University Degree"
label var    degreeW19   "Dummy: Has a University Degree or Equivalent, or is Currently at Uni"
label values degreeW19 degreeW19
replace degreeW19 = 1 if inlist(p_educationW19,13,14,15,16,17)
replace degreeW19 = 0 if degreeW19 != 1 & p_educationW19 !=. & p_educationW19 != 20

* Wave 21
gen degreeW21 =.
label define degreeW21 1 "University Degree or at Uni now" 0 "No University Degree"
label var    degreeW21   "Dummy: Has a University Degree or Equivalent, or is Currently at Uni"
label values degreeW21 degreeW21
replace degreeW21 = 1 if inlist(p_educationW21,13,14,15,16,17)
replace degreeW21 = 0 if degreeW21 != 1 & p_educationW21 !=. & p_educationW21 != 20



* Ethnicity

* Wave 10
gen ethnicityW10 =.
label define ethnicityW10 1 "White" 2 "Non-White / Mixed", replace
label variable ethnicityW10 "Respondent Ethnicity"
label values ethnicityW10 ethnicityW10 

replace ethnicityW10 = 1 if inlist(p_ethnicityW10,1,2)    | ethnicityW10 == . & inlist(p_ethnicityW9,1,2)  | ethnicityW10 == . & inlist(p_ethnicityW11,1,2) 
replace ethnicityW10 = 2 if inrange(p_ethnicityW10,3,15)  | ethnicityW10 == . & inlist(p_ethnicityW9,3,15) | ethnicityW10 == . & inlist(p_ethnicityW11,3,15)  

* Wave 19
gen ethnicityW19 =.
label define ethnicityW19 1 "White" 2 "Non-White / Mixed", replace
label variable ethnicityW19 "Respondent Ethnicity"
label values ethnicityW19 ethnicityW19 

replace ethnicityW19 = 1 if inlist(p_ethnicityW19,1,2) | ethnicityW19 == . & inlist(p_ethnicityW18,1,2)
replace ethnicityW19 = 2 if inrange(p_ethnicityW19,3,15) | ethnicityW19 == . & inlist(p_ethnicityW18,3,15)

* Wave 20
gen ethnicityW20 =.
label define ethnicityW20 1 "White" 2 "Non-White / Mixed", replace
label variable ethnicityW20 "Respondent Ethnicity"
label values ethnicityW20 ethnicityW20 

replace ethnicityW20 = 1 if inlist(p_ethnicityW20,1,2)   | ethnicityW20 == . & ethnicityW19 == 1 
replace ethnicityW20 = 2 if inrange(p_ethnicityW20,3,15) | ethnicityW20 == . & ethnicityW19 == 2


* Wave 21
gen ethnicityW21 =.
label define ethnicityW21 1 "White" 2 "Non-White / Mixed", replace
label variable ethnicityW21 "Respondent Ethnicity"
label values ethnicityW21 ethnicityW21 

replace ethnicityW21 = 1 if inlist(p_ethnicityW21,1,2)   | ethnicityW21 == . & ethnicityW20 == 1
replace ethnicityW21 = 2 if inrange(p_ethnicityW21,3,15) | ethnicityW21 == . & ethnicityW20 == 2





**** COMBINED CLASS - ETHNICITY GROUPS


* Wave 10
gen whites_allclassesW10 =.
label var whites_allclassesW10 "Occupational Class (All White Respondents)"
label define whites_allclassesW10 1 "Old Middle Class" 2 "New Middle Class" 3 "Intermediate Class" 4 "Own Account" 5 "Foremen + Supervisors" 6 "Working Class" 7 "Unidentified / Out of Labour Market" 99 "Ethnic Minority", replace
label values whites_allclassesW10 whites_allclassesW10

replace whites_allclassesW10 = 1 if objectiveclassW10 == 1 & ethnicityW10 == 1
replace whites_allclassesW10 = 2 if objectiveclassW10 == 2 & ethnicityW10 == 1
replace whites_allclassesW10 = 3 if objectiveclassW10 == 3 & ethnicityW10 == 1
replace whites_allclassesW10 = 4 if objectiveclassW10 == 4 & ethnicityW10 == 1
replace whites_allclassesW10 = 5 if objectiveclassW10 == 5 & ethnicityW10 == 1
replace whites_allclassesW10 = 6 if objectiveclassW10 == 6 & ethnicityW10 == 1
replace whites_allclassesW10 = 7 if objectiveclassW10 == 7 & ethnicityW10 == 1
replace whites_allclassesW10 = 99 if ethnicityW10 == 2

gen ClassGroup_W10 =.
label define ClassGroup_W10 1 "White Working Class" 2 "White Graduates" 3 "Ethnic Minorities" 4 "Other Whites", replace
label values ClassGroup_W10 ClassGroup_W10

replace ClassGroup_W10 = 1 if whites_allclassesW10 == 6 & ethnicityW10 == 1 & degreeW10 == 0
replace ClassGroup_W10 = 2 if whites_allclassesW10 !=.  & ethnicityW10 == 1 & degreeW10 == 1
replace ClassGroup_W10 = 3 if ClassGroup_W10 ==.        & ethnicityW10 == 2 & degreeW10 != . 
replace ClassGroup_W10 = 4 if ClassGroup_W10 ==.        & ethnicityW10 == 1 & degreeW10 != .



* Wave 19
gen whites_allclassesW19 =.
label var whites_allclassesW19 "Occupational Class (All White Respondents)"
label define whites_allclassesW19 1 "Old Middle Class" 2 "New Middle Class" 3 "Intermediate Class" 4 "Own Account" 5 "Foremen + Supervisors" 6 "Working Class" 7 "Unidentified / Out of Labour Market" 99 "Ethnic Minority", replace
label values whites_allclassesW19 whites_allclassesW19

replace whites_allclassesW19 = 1 if objectiveclassW19 == 1 & ethnicityW19 == 1
replace whites_allclassesW19 = 2 if objectiveclassW19 == 2 & ethnicityW19 == 1
replace whites_allclassesW19 = 3 if objectiveclassW19 == 3 & ethnicityW19 == 1
replace whites_allclassesW19 = 4 if objectiveclassW19 == 4 & ethnicityW19 == 1
replace whites_allclassesW19 = 5 if objectiveclassW19 == 5 & ethnicityW19 == 1
replace whites_allclassesW19 = 6 if objectiveclassW19 == 6 & ethnicityW19 == 1
replace whites_allclassesW19 = 7 if objectiveclassW19 == 7 & ethnicityW19 == 1
replace whites_allclassesW19 = 99 if ethnicityW19 == 2

gen ClassGroup_W19 =.
label define ClassGroup_W19 1 "White Working Class" 2 "White Graduates" 3 "Ethnic Minorities" 4 "Other Whites", replace
label values ClassGroup_W19 ClassGroup_W19

replace ClassGroup_W19 = 1 if whites_allclassesW19 == 6 & ethnicityW19 == 1 & degreeW19 == 0
replace ClassGroup_W19 = 2 if whites_allclassesW19 !=.  & ethnicityW19 == 1 & degreeW19 == 1
replace ClassGroup_W19 = 3 if ClassGroup_W19 ==.        & ethnicityW19 == 2 & degreeW19 != . 
replace ClassGroup_W19 = 4 if ClassGroup_W19 ==.        & ethnicityW19 == 1 & degreeW19 != .


* Wave 21
gen whites_allclassesW21 =.
label var whites_allclassesW21 "Occupational Class (All White Respondents)"
label define whites_allclassesW21 1 "Old Middle Class" 2 "New Middle Class" 3 "Intermediate Class" 4 "Own Account" 5 "Foremen + Supervisors" 6 "Working Class" 7 "Unidentified / Out of Labour Market" 99 "Ethnic Minority", replace
label values whites_allclassesW21 whites_allclassesW21

replace whites_allclassesW21 = 1 if objectiveclassW21 == 1 & ethnicityW21 == 1
replace whites_allclassesW21 = 2 if objectiveclassW21 == 2 & ethnicityW21 == 1
replace whites_allclassesW21 = 3 if objectiveclassW21 == 3 & ethnicityW21 == 1
replace whites_allclassesW21 = 4 if objectiveclassW21 == 4 & ethnicityW21 == 1
replace whites_allclassesW21 = 5 if objectiveclassW21 == 5 & ethnicityW21 == 1
replace whites_allclassesW21 = 6 if objectiveclassW21 == 6 & ethnicityW21 == 1
replace whites_allclassesW21 = 7 if objectiveclassW21 == 7 & ethnicityW21 == 1
replace whites_allclassesW21 = 99 if ethnicityW21 == 2

gen ClassGroup_W21 =.
label define ClassGroup_W21 1 "White Working Class" 2 "White Graduates" 3 "Ethnic Minorities" 4 "Other Whites", replace
label values ClassGroup_W21 ClassGroup_W21

replace ClassGroup_W21 = 1 if whites_allclassesW21 == 6 & ethnicityW21 == 1 & degreeW21 == 0
replace ClassGroup_W21 = 2 if whites_allclassesW21 !=.  & ethnicityW21 == 1 & degreeW21 == 1
replace ClassGroup_W21 = 3 if ClassGroup_W21 ==.        & ethnicityW21 == 2 & degreeW21 != . 
replace ClassGroup_W21 = 4 if ClassGroup_W21 ==.        & ethnicityW21 == 1 & degreeW21 != .


*** COUNTRY

* Wave 10
gen UKcountryW10 =.
label variable UKcountryW10 "Constituent UK Country (W19 or Other Most Current)"
label define countryW10 1 "England" 2 "Wales" 3 "Scotland"
label values UKcountryW10 countryW10

replace UKcountryW10 = 1 if countryW10 == 1
replace UKcountryW10 = 2 if countryW10 == 3
replace UKcountryW10 = 3 if countryW10 == 2

* Wave 19
gen UKcountryW19 =.
label variable UKcountryW19 "Constituent UK Country (W19 or Other Most Current)"
label define countryW19 1 "England" 2 "Wales" 3 "Scotland"
label values UKcountryW19 countryW19

replace UKcountryW19 = 1 if countryW19 == 1
replace UKcountryW19 = 2 if countryW19 == 3
replace UKcountryW19 = 3 if countryW19 == 2

* Wave 21
gen UKcountryW21 =.
label variable UKcountryW21 "Constituent UK Country (W19 or Other Most Current)"
label define countryW21 1 "England" 2 "Wales" 3 "Scotland"
label values UKcountryW21 countryW21

replace UKcountryW21 = 1 if countryW21 == 1
replace UKcountryW21 = 2 if countryW21 == 3
replace UKcountryW21 = 3 if countryW21 == 2


* GENDER

* Female
gen female =.
replace female = 1 if gender == 2
replace female = 0 if gender == 1

rename Age age



* AGE GROUPS


* Wave 10
gen agegrpW10 =.
label variable agegrpW10 "Age (4 Groups)"
label define agegrpW10 1 "18-25" 2 "26-44" 3 "45-64" 4 "65+"
label values agegrpW10 agegrpW10

replace agegrpW10 = 1 if inrange(ageW10,16,25)
replace agegrpW10 = 2 if inrange(ageW10,26,44)
replace agegrpW10 = 3 if inrange(ageW10,45,64)
replace agegrpW10 = 4 if inrange(ageW10,65,120)

* Wave 19
gen agegrpW19 =.
label variable agegrpW19 "Age (4 Groups)"
label define agegrpW19 1 "18-25" 2 "26-44" 3 "45-64" 4 "65+"
label values agegrpW19 agegrpW19

replace agegrpW19 = 1 if inrange(ageW19,16,25)
replace agegrpW19 = 2 if inrange(ageW19,26,44)
replace agegrpW19 = 3 if inrange(ageW19,45,64)
replace agegrpW19 = 4 if inrange(ageW19,65,120)

* Wave 21
gen agegrpW21 =.
label variable agegrpW21 "Age (4 Groups)"
label define agegrpW21 1 "18-25" 2 "26-44" 3 "45-64" 4 "65+"
label values agegrpW21 agegrpW21

replace agegrpW21 = 1 if inrange(ageW21,16,25)
replace agegrpW21 = 2 if inrange(ageW21,26,44)
replace agegrpW21 = 3 if inrange(ageW21,45,64)
replace agegrpW21 = 4 if inrange(ageW21,65,120)




* TU MEMBERSHIP

* Wave 10
gen TUmemW2W17 =.
label var TUmemW2W17 "Current TU Member"
label define TUmemW2W17 1 "Yes" 0 "No"
label values TUmemW2W17 TUmemW2W17
replace TUmemW2W17 = 0 if currentUnionMemberW2_W12_W14_W17 == 0 | currentUnionMemberW2_W12_W14_W17 == 9999
replace TUmemW2W17 = 1 if currentUnionMemberW2_W12_W14_W17 == 1


*Wave 19/20
gen TUmemW19W20 =.
label var TUmemW19W20 "Current TU Member"
label define TUmemW19W20 1 "Yes" 0 "No"
label values TUmemW19W20 TUmemW19W20
replace TUmemW19W20 = 0 if currentUnionMemberW19W20 == 0 | currentUnionMemberW19W20 == 9999
replace TUmemW19W20 = 1 if currentUnionMemberW19W20 == 1


* RELIGION

* Wave 10
gen religionW10 =.
label define religionW10 1 "Church of England"  2 "Catholic"  3 "Church of Scotland / Presb"  4 "Other Christian" 5 "Non Christian" 6 "No Religion", replace
label variable religionW10 "Religion (7 Categories)"
label values religionW10 religionW10

replace religionW10 = 1 if inlist(p_religionW10,2)
replace religionW10 = 2 if inlist(p_religionW10,3)
replace religionW10 = 3 if inlist(p_religionW10,4)
replace religionW10 = 4 if inlist(p_religionW10,5,6,7,8,9,17,18,19)
replace religionW10 = 5 if inrange(p_religionW10,10,15)
replace religionW10 = 6 if inlist(p_religionW10,1)

* Wave 19
gen religionW19 =.
label define religionW19 1 "Church of England"  2 "Catholic"  3 "Church of Scotland / Presb"  4 "Other Christian" 5 "Non Christian" 6 "No Religion", replace
label variable religionW19 "Religion (7 Categories)"
label values religionW19 religionW19

replace religionW19 = 1 if inlist(p_religionW19,2)
replace religionW19 = 2 if inlist(p_religionW19,3)
replace religionW19 = 3 if inlist(p_religionW19,4)
replace religionW19 = 4 if inlist(p_religionW19,5,6,7,8,9,17,18,19)
replace religionW19 = 5 if inrange(p_religionW19,10,15)
replace religionW19 = 6 if inlist(p_religionW19,1)




* WHITE ETHNOCENTRISM (Feeling Thermometer: Feeling for WHites - av(Feeling Blacks + Feeling Asians))

order warmWhiteW11 warmAsianW11 warmBlackW11, after(partyIdSqueezeW21)

foreach var of varlist warmWhiteW11 -  warmBlackW11 {
        replace `var' =. if `var' == 9999
}

gen warmBMEW11 = (warmAsianW11 + warmBlackW11)/2

gen ethnocentrismw11 = (warmWhiteW11 - warmBMEW11) / 10
label var ethnocentrismw11 "Respondent White Ethnocentrism (How Much More likes Whites than BME)"
label define ethno -10 "Wholly BMEcentric" 0 "Neutral" 10 "Wholly Whitecentric", replace
	 
		 
	

* PERCEPTIONS OF LABOUR'S RELATIVE GROUP REPRESENTATION  OF WORKING CLASS, BLACK AND ASIANS AND MIDDLE CLASS PEOPLE (Only with Full Sample in Wave 10/ Wave 21)


* Drop missing values (don't knows) and recode to run 0 (Labour not rep group closely) to 3 (Labour rep group v close)


* Black and Asians
foreach var of varlist  labLookAfterBAW10 labLookAfterBAW19 labLookAfterBAW21 {
        replace `var' =. if `var' == 9999
		replace `var' = `var' - 1
}

* Middle Class
foreach var of varlist  labLookAfterMCW10 labLookAfterMCW19 labLookAfterMCW21 {
        replace `var' =. if `var' == 9999
		replace `var' = `var' - 1
}

* Working Class
foreach var of varlist  labLookAfterWCW10 labLookAfterWCW19 labLookAfterWCW21 {
        replace `var' =. if `var' == 9999
		replace `var' = `var' - 1
}
	

label define labrep 0 "Reps Not at all Closely" 1 "Reps Not Very Closely" 2 "Reps Fairly Closely" 3 "Reps Very Closely", replace
label values labLookAfter* labrep
	
	
* PERCEPTIONS OF LABOUR'S RELATIVE GROUP REPRESENTATION OF BLACK/ASIANS V WORKING CLASS	
	

* Wave 10	
gen labLookAfterBAWvWCW10 =.
label variable labLookAfterBAWvWCW10 "Who does Lab rep better: the WC or blacks and Asians? (-3 to +3, Higher = Black/Asian)"
replace labLookAfterBAWvWCW10 = labLookAfterBAW10 - labLookAfterWCW10
recode labLookAfterBAWvWCW10 (-3 = -3) (-2 = -2) (-1 = -1) (0=0) (1 = 1) (2 = 2) (3 = 3) (else=.)
 
* Wave 19	
gen labLookAfterBAWvWCW19 =.
label variable labLookAfterBAWvWCW19 "Who does Lab rep better: the WC or blacks and Asians? (-3 to +3, Higher = Black/Asian)"
replace labLookAfterBAWvWCW19 = labLookAfterBAW19 - labLookAfterWCW19
recode labLookAfterBAWvWCW19 (-3 = -3) (-2 = -2) (-1 = -1) (0=0) (1 = 1) (2 = 2) (3 = 3) (else=.)

* Wave 21 
gen labLookAfterBAWvWCW21 =.
label variable labLookAfterBAWvWCW21 "Who does Lab rep better: the WC or blacks and Asians? (-3 to +3, Higher = Black/Asian)"
replace labLookAfterBAWvWCW21 = labLookAfterBAW21 - labLookAfterWCW21
recode labLookAfterBAWvWCW21 (-3 = -3) (-2 = -2) (-1 = -1) (0=0) (1 = 1) (2 = 2) (3 = 3) (else=.)
 
	
label define groupbias -3 "Pro-WC Bias" 0 "Equal" 3 "Pro-BME Bias", replace
label values labLookAfterBAWvWCW* groupbias

	
	
* STRENGTH OF LABOUR PARTISANSHIP CONTROL 	

* Wave 10
gen labIDstrengthW10 = .
label var labIDstrengthW10 "Strength of Labour Party Identification W10"
label define labIDstrengthW10 0 "No Labour ID" 1 "Not Very Strong Labour ID" 2 "Fairly Strong Labour ID" 3 "Very Strong Labour ID"
label values labIDstrengthW10  	labIDstrengthW10 
	
replace labIDstrengthW10 = 0 if partyIdW10 == 1 | inrange(partyIdW10,3,12)
replace labIDstrengthW10 = 1 if partyIdW10 == 2  & partyIdStrengthW10 == 3
replace labIDstrengthW10 = 2 if partyIdW10 == 2  & partyIdStrengthW10 == 2
replace labIDstrengthW10 = 3 if partyIdW10 == 2  & partyIdStrengthW10 == 1	
	
replace labIDstrengthW10 = 0 if labIDstrengthW10 ==. &  partyIdSqueezeW10 == 1 | labIDstrengthW10 ==. &  inrange(partyIdSqueezeW10,3,12)
replace labIDstrengthW10 = 1 if labIDstrengthW10 ==. &  partyIdSqueezeW10 == 2  & partyIdStrengthW10 == 3
replace labIDstrengthW10 = 2 if labIDstrengthW10 ==. &  partyIdSqueezeW10 == 2  & partyIdStrengthW10 == 2
replace labIDstrengthW10 = 3 if labIDstrengthW10 ==. &  partyIdSqueezeW10 == 2  & partyIdStrengthW10 == 1	
	
	
	
* VOTE / VOTE INTENTION (MAIN DEPENDENT VARIABLE)


* Wave 10 (Nov-Dec 2016)
gen voteW10 =.
label variable voteW10 "Vote Intention W10 (Dec 2016)"	 
label define voteW10 0 "Non-Voter" 1 "Conservative" 2 "Labour" 3 "LibDem" 4 "SNP" 5 "Plaid Cymru" 6 "UKIP/BP" 7 "Greens" 8 "Change-UK" 9 "Other", replace 
label values voteW10 voteW10
	 
replace voteW10 = 0 if generalElectionVoteW10 == 0 
replace voteW10 = 1 if generalElectionVoteW10 == 1	 
replace voteW10 = 2 if generalElectionVoteW10 == 2	 	 
replace voteW10 = 3 if generalElectionVoteW10 == 3	 	 
replace voteW10 = 4 if generalElectionVoteW10 == 4	 	 
replace voteW10 = 5 if generalElectionVoteW10 == 5	 	 
replace voteW10 = 6 if generalElectionVoteW10 == 6	 	 
replace voteW10 = 7 if generalElectionVoteW10 == 7	 	 		 
replace voteW10 = 9 if generalElectionVoteW10 == 9			 
	 
gen voteLabW10 =.
label var voteLabW10 "Would Vote Labour v Other W10 (Dec 2016)"
label define voteLabW10 1 "Labour" 0 "Other"
label values voteLabW10 voteLabW10 	 
	 
replace voteLabW10 = 1 if voteW10 == 2
replace voteLabW10 = 0 if voteW10 == 1 | inrange(voteW10,3,9)
	 
gen voteLabW10ALT =.
label var voteLabW10ALT "Would Vote Labour v Other W10 (Dec 2016) - Inc. Non-Voters"
label define voteLabW10ALT 1 "Labour" 0 "Other"
label values voteLabW10ALT voteLabW10ALT	 
	 
replace voteLabW10ALT= 1 if voteW10 == 2
replace voteLabW10ALT = 0 if voteW10 == 1 | inrange(voteW10,3,12) | voteW10 == 0

	 
* Wave 13 (June 2017 Election Vote)	 
gen voteW13 =.
label variable voteW13 "Vote 2017 Election"	 
label define voteW13 0 "Non-Voter" 1 "Conservative" 2 "Labour" 3 "LibDem" 4 "SNP" 5 "Plaid Cymru" 6 "UKIP/BP" 7 "Greens" 8 "Change-UK" 9 "Other", replace 
label values voteW13 voteW13
	 
replace voteW13 = 0 if genElecTurnoutRetroW13 == 0 
replace voteW13 = 1 if generalElectionVoteW13 == 1	 
replace voteW13 = 2 if generalElectionVoteW13 == 2	 	 
replace voteW13 = 3 if generalElectionVoteW13 == 3	 	 
replace voteW13 = 4 if generalElectionVoteW13 == 4	 	 
replace voteW13 = 5 if generalElectionVoteW13 == 5	 	 
replace voteW13 = 6 if generalElectionVoteW13 == 6	 	 
replace voteW13 = 7 if generalElectionVoteW13 == 7	 	 		 
replace voteW13 = 9 if generalElectionVoteW13 == 9			 	 
	 
gen voteLabW13 =.
label var voteLabW13 "Voted Labour v Other W13 (June 2017 Election)"
label define voteLabW13 1 "Labour" 0 "Other"
label values voteLabW13 voteLabW13 	 
	 
replace voteLabW13 = 1 if voteW13 == 2
replace voteLabW13 = 0 if voteW13 == 1 | inrange(voteW13,3,9)	 
	 
	 
gen voteLabW13ALT =.
label var voteLabW13ALT "Voted Labour v Other W13 (June 2017 Election)"
label define voteLabW13ALT 1 "Labour" 0 "Other"
label values voteLabW13ALT voteLabW13ALT	 
	 
replace voteLabW13ALT = 1 if voteW13 == 2
replace voteLabW13ALT = 0 if voteW13 == 1 | inrange(voteW13,3,9) | voteW13 == 0	 
	 
	 	 
* Wave 19 (Dec 2019 Election Vote)	 	 
gen voteW19 =.
label variable voteW19 "Vote 2019 Election"	 
label define voteW19 0 "Non-Voter" 1 "Conservative" 2 "Labour" 3 "LibDem" 4 "SNP" 5 "Plaid Cymru" 6 "UKIP/BP/Reform" 7 "Greens" 8 "Change-UK" 9 "Other", replace 
label values voteW19 voteW19
	 
replace voteW19 = 0 if genElecTurnoutRetroW19 == 0 
replace voteW19 = 1 if generalElectionVoteW19 == 1	 
replace voteW19 = 2 if generalElectionVoteW19 == 2	 	 
replace voteW19 = 3 if generalElectionVoteW19 == 3	 	 
replace voteW19 = 4 if generalElectionVoteW19 == 4	 	 
replace voteW19 = 5 if generalElectionVoteW19 == 5	 	 
replace voteW19 = 6 if generalElectionVoteW19 == 6 | generalElectionVoteW19 == 12	 	 
replace voteW19 = 7 if generalElectionVoteW19 == 7	 
replace voteW19 = 8 if generalElectionVoteW19 == 8	
replace voteW19 = 9 if generalElectionVoteW19 == 9 | generalElectionVoteW19 == 13		 	 
	 	 
gen voteLabW19 =.
label var voteLabW19 "Voted Labour v Other W19 (Dec 2019 Election)"
label define voteLabW19 1 "Labour" 0 "Other"
label values voteLabW19 voteLabW19 	 
	 
replace voteLabW19 = 1 if voteW19 == 2
replace voteLabW19 = 0 if voteW19 == 1 | inrange(voteW19,3,9)	 
	 
	 
gen voteLabW19ALT =.
label var voteLabW19ALT "Would Vote Labour v Other W19 (Dec 2016) - Inc. Non-Voters"
label define voteLabW19ALT 1 "Labour" 0 "Other"
label values voteLabW19ALT voteLabW19ALT	 
	 
replace voteLabW19ALT= 1 if voteW19 == 2
replace voteLabW19ALT = 0 if voteW19 == 1 | inrange(voteW19,3,12) | voteW19 == 0
	 
	 
	 
	 
*** PROPENSITY TO VOTE (PTV) LABOUR, 0 (Unlikely) to 10 (Very Likely) (ALTERNATIVE DEPENDENT VARIABLE - Not available in 2019)	 

* Wave 10 (Nov-Dec 2016)
replace ptvLabW10 =. if ptvLabW10 == 9999

	

*** IMMIGRATION ATTITUDES (ALT. CONTROL VAR FOR ETHNOCENTRISM, 0-10: Higher = More Pro Immig)	 

* Wave 10
replace immigSelfW10 =. if immigSelfW10 == 9999

* Wave 17 (Nov 2019, Closest Available Measure to Dec 2019 Wave 19 Election Wave)
replace immigSelfW17 =. if immigSelfW17 == 9999



*** EU/BREXIT ATTITUDES (ALT. CONTROL VARIABLE IN ROBUSTNESS TEST, 0-10: Higher = More Anti-EU)

* Wave 10	 
replace EUIntegrationSelfW10 =. if EUIntegrationSelfW10 == 9999

* Wave 19
replace EUIntegrationSelfW19 =. if EUIntegrationSelfW19 == 9999





** CLASS IDENTITY (ALT. MEASURE OF SOCIAL CLASS USED IN ROBUSTNESS TEST)


* Wave 10
gen subjectiveclassW10 =.
label define subjectiveclassW10 1 "No / DK / Other" 2 "Middle Class" 3 "Working Class", replace
label variable subjectiveclassW10 "Subjective Class"
label values subjectiveclassW10 subjectiveclassW10
 
replace subjectiveclassW10 = 1 if subjectiveclassW10 ==. & inlist(subjClassW10W11,0,3,9999)
replace subjectiveclassW10 = 2 if subjectiveclassW10 ==. & subjClassW10W11 == 1 
replace subjectiveclassW10 = 3 if subjectiveclassW10 ==. & subjClassW10W11 == 2 

gen racialclassidentity_W10 =.
replace racialclassidentity_W10 = 1 if subjectiveclassW10 == 3 & ethnicityW10 == 1
replace racialclassidentity_W10 = 2 if subjectiveclassW10 == 2 & ethnicityW10 == 1
replace racialclassidentity_W10 = 3 if subjectiveclassW10 == 1 & ethnicityW10 == 1
replace racialclassidentity_W10 = 99 if ethnicityW10 == 2
label var racialclassidentity_W10 "Subjective Class + Ethnicity"
label define label1 1 "White WC Identity" 2 "White MC Identity" 3 "White No Class Identity" 99 "Ethnic Minority", replace
label values  racialclassidentity_W10 label1


* Wave 19
gen subjectiveclassW19 =.
label define subjectiveclassW19 1 "No / DK / Other" 2 "Middle Class" 3 "Working Class", replace
label variable subjectiveclassW19 "Subjective Class"
label values subjectiveclassW19 subjectiveclassW19
	 
replace subjectiveclassW19 = 1 if inlist(subjClassW19,0,3,9999)
replace subjectiveclassW19 = 2 if subjClassW19 == 1 | subjClassSqueezeW19 == 1 
replace subjectiveclassW19 = 3 if subjClassW19 == 2 | subjClassSqueezeW19 == 2 

gen racialclassidentity_W19 =.
replace racialclassidentity_W19 = 1 if subjectiveclassW19 == 3 & ethnicityW19 == 1
replace racialclassidentity_W19 = 2 if subjectiveclassW19 == 2 & ethnicityW19 == 1
replace racialclassidentity_W19 = 3 if subjectiveclassW19 == 1 & ethnicityW19 == 1
replace racialclassidentity_W19 = 99 if ethnicityW19 == 2
label var racialclassidentity_W19 "Subjective Class + Ethnicity"
label values  racialclassidentity_W19 label1


keep id wt_new_W10 wt_new_W19_result wt_new_W13W19 wt_new_W21 ClassGroup_W10 ClassGroup_W19 ClassGroup_W21 labLookAfterWCW10 labLookAfterBAW10 labLookAfterMCW10 labLookAfterBAWvWCW10 labLookAfterWCW19 labLookAfterBAW19 labLookAfterMCW19 labLookAfterBAWvWCW19 labLookAfterWCW21 labLookAfterBAW21 labLookAfterMCW21 labLookAfterBAWvWCW21 agegrpW10 female UKcountryW10 ethnocentrismw11 immigSelfW10 EUIntegrationSelfW10 lr_scaleW10_W12 al_scaleW10_W12 voteLabW10 voteLabW13 voteLabW19 labIDstrengthW10 objectiveclassW19 ethnicityW19 ageW19 p_housingW19 p_edlevelW19 p_gross_householdW19 racialclassidentity_W10 racialclassidentity_W19 agegrpW19 UKcountryW19 TUmemW2W17 religionW10 TUmemW19W20 religionW19 al_scaleW21 lr_scaleW21 EUIntegrationSelfW19 immigSelfW17 ptvLabW10 voteLabW10ALT voteLabW13ALT voteLabW19ALT voteW19

* Relabel for Clarity 

label var id  "Respondent BES ID Number"
label var wt_new_W10  "BES Wave 10 Survey Weight"
label var wt_new_W19_result  "BES Wave 19 Survey Weight"
label var wt_new_W21   "BES Wave 21 Survey Weight"
label var wt_new_W13W19  "BES Waves 13-19 Panel Weight"
label var ClassGroup_W10 "Class-Ethnicity Group (Main Independent Var) - Wave 10"
label var ClassGroup_W19 "Class-Ethnicity Group (Main Independent Var) - Wave 19"
label var ClassGroup_W21 "Class-Ethnicity Group (Main Independent Var) - Wave 21"
label var voteLabW10  "Vote Choice - Labour v Other Party - Wave 10 (2016)"
label var voteLabW13  "Vote Choice - Labour v Other Party - Wave 13 (2017)"
label var voteLabW19  "Vote Choice - Labour v Other Party - Wave 19 (2019)"
label var voteLabW10ALT  "Vote Choice - Labour v Other Party / Abstain - Wave 10 (2016)"
label var voteLabW13ALT  "Vote Choice - Labour v Other Party / Abstain - Wave 13 (2017)"
label var voteLabW19ALT  "Vote Choice - Labour v Other Party / Abstain - Wave 19 (2019)"
label var voteW19 "Vote Choice (Full) - Wave 19 (2019 General Election)"
label var ptvLabW10 "Subjective Propensity to Vote Labour (0-10) - Wave 10"
label var labIDstrengthW10  "Strength of Labour Partisanship - Wave 10"
label var objectiveclassW19 "Occupation Class - Wave 19"
label var ethnicityW19  "Race (White v Non-White/Mixed)- Wave 19"
label var ageW19  "Age - Wave 19"
label var p_housingW19 "Housing Tenure - Wave 19"
label var p_edlevelW19 "Level of Education - Wave 19"
label var p_gross_householdW19 "Gross HH Income - Wave 19"
label var racialclassidentity_W10 "Subjective Class Identity * Race - Wave 10"
label var racialclassidentity_W19 "Subjective Class Identity * Race - Wave 19"
label var female "Female"
label var agegrpW10 "Age Group (18-25, 26-44, 45-64, 65+) - Wave 10"
label var UKcountryW10 "UK Country (Eng, Scot, Wales) - Wave 10"
label var agegrpW19 "Age Group (18-25, 26-44, 45-64, 65+) - Wave 19"
label var UKcountryW19 "UK Country (Eng, Scot, Wales) - Wave 19"
label var TUmemW2W17 "Trade Union Membership - Wave 2 - Wave 17" 
label var TUmemW19W20 "Trade Union Membership - Wave 19 - Wave 20"
label var religionW10  "Religious Identity - Wave 10" 
label var religionW19  "Religious Identity - Wave 19"
label var ethnocentrismw11 "White Ethnocentrism Scale (0-10, Higher = Closer to whites than non-whites)- Wave 11"
label var immigSelfW10 "Pro-Immigration Attitudes Scale (0-10, Higher = More Pro-Immig) - Wave 10"
label var immigSelfW17 "Pro-Immigration Attitudes Scale (0-10, Higher = More Pro-Immig) - Wave 17"
label var EUIntegrationSelfW10 "Pro-EU Integration Attitudes Scale (0-10, Higher = More Pro-EU) - Wave 10"
label var EUIntegrationSelfW19 "Pro-EU Integration Attitudes Scale (0-10, Higher = More Pro-EU) - Wave 19"
label var lr_scaleW10_W12  "Econ Left-Right Attitudes Scale (0-10, Higher = More Econ RW) - Wave 10"
label var al_scaleW10_W12 "Social Lib-Auth Attitudes Scale (0-10, Higher = More Socially Auth) - Wave 10"
label var lr_scaleW21  "Econ Left-Right Attitudes Scale (0-10, Higher = More Econ RW) - Wave 21"
label var al_scaleW21  "Social Lib-Auth Attitudes Scale (0-10, Higher = More Socially Auth) - Wave 21"
label var labLookAfterWCW10  "Evaulation of Labour Working Class Representation, 0-3 (Wave 10)"
label var labLookAfterBAW10  "Evaulation of Labour Black/Asian Representation, 0-3 (Wave 10)"
label var labLookAfterMCW10  "Evaulation of Labour Middle Class Representation, 0-3 (Wave 10)"
label var labLookAfterBAWvWCW10   "Does Lab Better Rep WC or Blacks/Asians, -3 to +3 (Higher = Black) (Wave 10)"
label var labLookAfterWCW19  "Evaulation of Labour Working Class Representation, 0-3 (Wave 19)"
label var labLookAfterBAW19  "Evaulation of Labour Black/Asian Representation, 0-3 (Wave 19)"
label var labLookAfterMCW19  "Evaulation of Labour Middle Class Representation, 0-3 (Wave 19)"
label var labLookAfterBAWvWCW19   "Does Lab Better Rep WC or Blacks/Asians, -3 to +3 (Higher = Black) (Wave 19)"
label var labLookAfterWCW21  "Evaulation of Labour Working Class Representation, 0-3 (Wave 21)"
label var labLookAfterBAW21  "Evaulation of Labour Black/Asian Representation, 0-3 (Wave 21)"
label var labLookAfterMCW21  "Evaulation of Labour Middle Class Representation, 0-3 (Wave 21)"
label var labLookAfterBAWvWCW21   "Does Lab Better Rep WC or Blacks/Asians, -3 to +3 (Higher = Black) (Wave 21)"

STOP


*******************************************************************************************************************************************



*** ANALYSIS AND RESULTS - MAIN TEXT

*** Vote Totals Mentioned First Page (i.e. gap in Labour Voting in 2019 between White WC and Non-White WC)

gen raceclass =. //* Categorical var distinguishing between white WC and non-white WC (based on occupation)
label define raceclass 1 "White WC" 2 "Non-White WC" 3 "Other White" 4 "Other Non-Whites", replace
label values raceclass raceclass

replace raceclass = 1 if objectiveclassW19 == 6 & ethnicityW19 == 1 //* WC Occupation + White
replace raceclass = 2 if objectiveclassW19 == 6 & ethnicityW19 == 2 //* WC Occupation + Non-White/Mixed
replace raceclass = 3 if raceclass ==. & ethnicityW19 == 1 & objectiveclassW19 != .  //* All Non-WC Whites
replace raceclass = 4 if raceclass ==. & ethnicityW19 == 2 & objectiveclassW19 != .  //* All Non-WC Non-Whites/Mixed

svyset [pweight= wt_new_W19_result], psu(id)

svy: tab voteLabW19 raceclass                                                               if ageW19 !=. & p_housingW19 !=. & p_edlevelW19 !=. & p_gross_householdW19 != ., col   //* WWC = 29%  ; Non-White WC = 58% ;  W not WC = 32%;  BME not WC = 60%
svy: reg voteLabW19 i.raceclass                                                              if ageW19 !=. & p_housingW19 !=. & p_edlevelW19 !=. & p_gross_householdW19 != .        //* 30% point gap (White WC v Non-White WC)
svy: reg voteLabW19 i.raceclass ageW19 i.p_housingW19 i.p_edlevelW19 i.p_gross_householdW19  if ageW19 !=. & p_housingW19 !=. & p_edlevelW19 !=. & p_gross_householdW19 != .        //* 18% point gap (White WC v Non-White WC)


************************************************

*** TABLE 1 ('The Impact of Evaluations of Labour's Black and Asian Representation on Evaluations of Labour's Working Class Representation, Interacted with Respondent Class-Ethnicity Group')

svyset [pweight= wt_new_W10], psu(id)	
						
* Model A *		(Restrict sample to those with non-missing values on later controls, but results the same if use full sample.)
svy: reg labLookAfterWCW10 c.labLookAfterBAW10##ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10   if ethnocentrismw11 !=. & lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. & labIDstrengthW10 !=. 

* Model B *		
svy: reg labLookAfterWCW10 c.labLookAfterBAW10##ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10 ethnocentrismw11  if lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. & labIDstrengthW10 !=. 

* Model C *		
svy: reg labLookAfterWCW10 c.labLookAfterBAW10##ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10 ethnocentrismw11 lr_scaleW10_W12 al_scaleW10_W12 i.labIDstrengthW10 


*** FIGURE 3
margins, at(labLookAfterBAW10=(0(1)3) ClassGroup_W10=(1) agegrpW10=(3) female=(0) UKcountryW10=(1) labIDstrengthW10=(0)) atmeans saving(file1, replace) 
margins, at(labLookAfterBAW10=(0(1)3) ClassGroup_W10=(2) agegrpW10=(3) female=(0) UKcountryW10=(1) labIDstrengthW10=(0)) atmeans saving(file2, replace) 
margins, at(labLookAfterBAW10=(0(1)3) ClassGroup_W10=(3) agegrpW10=(3) female=(0) UKcountryW10=(1) labIDstrengthW10=(0)) atmeans saving(file3, replace) 

combomarginsplot file1 file2 file3, labels("White Working Class" "White Graduates" "Ethnic Minorities") ///
										title("{bf: Model D: + Strength Labour Partisanship Control}", size(medsmall) color(black)) ///
										addplot(hist labLookAfterBAW10, ///
                                        blcolor(gs2) fcolor(%20) lc(gs2%10) color(gs2) ///
			                            percent  ///
			                            yaxis(2)   ////
			                            yscale(alt axis(2)) ///
										ytitle("{bf: Distribution of Evaluations of}" "{bf: Labour's Black/Asian Representation}", axis(2) size(small) orientation(rvertical)) ///
			                            ylabel(0 "0%" 10 "10%" 20 "20%" 30 "30%" 40 "40%" 50 "50%", ///
		                             	labcolor() axis(2) tlcolor(black) tlwidth(thin) labsize(vsmall) angle(0) nogrid) ///
			                            ytitle("{bf: Predicted Evaluation}" "{bf: of Labour's Working}" "{bf: Class Representation}" `"{bf:(0-3)}"', orientation(horizontal)) ///
										xtitle("{bf: Evaluation of Labour's Black/Asian Representation (0-3)}")) ///
										xlabel(0 "0" 1 "1" 2 "2" 3 "3", labsize(small)) ///
										ylabel(0 "0" .5 ".5" 1 "1" 1.5 "1.5" 2 "2" 2.5 "2.5", labsize(small) angle(0) nogrid)  ///
                                        graphregion(color(white)) bgcolor(white) ///
										plot1opts(lcolor(red) mcolor(red)) plot2opts(lcolor(midblue) mcolor(midblue)) plot3opts(lcolor(black) mcolor(black)) ///
										ci1opt(recast(rarea) color(red%66) fintensity(50)) ci2opt(recast(rarea) color(midblue%66) fintensity(50)) ci3opt(color(black) fintensity(0))
	
*****************************************************	
	
*** TABLE 2 ('The Impact of Evaluations of Labour's Black and Asian, Middle Class, and Working Class Representation on Support for Labour, by Respondent Class-Ethnicity Group')

svyset [pweight= wt_new_W10], psu(id)

* Model A (Restrict sample to those with non-missing values on later controls, but results the same if use full sample.)
svy:  logit  voteLabW10 c.labLookAfterBAW10##ib1.ClassGroup_W10 c.labLookAfterMCW10##ib1.ClassGroup_W10 c.labLookAfterWCW10##ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10  if ethnocentrismw11 !=.& lr_scaleW10_W12 !=. & al_scaleW10_W12 !=.  

* Model B
svy:  logit  voteLabW10 c.labLookAfterBAW10##ib1.ClassGroup_W10 c.labLookAfterMCW10##ib1.ClassGroup_W10 c.labLookAfterWCW10##ib1.ClassGroup_W10 i.agegrpW10  female i.UKcountryW10 ethnocentrismw11 if lr_scaleW10_W12 !=. & al_scaleW10_W12 !=.

* Model C
svy:  logit  voteLabW10 c.labLookAfterBAW10##ib1.ClassGroup_W10 c.labLookAfterMCW10##ib1.ClassGroup_W10 c.labLookAfterWCW10##ib1.ClassGroup_W10 i.agegrpW10  female i.UKcountryW10 ethnocentrismw11 lr_scaleW10_W12 al_scaleW10_W12 


*** FIGURE 4

* Figure 4a										
margins, at(labLookAfterWCW10=(0(1)3) ClassGroup_W10=(1) agegrpW10=(3) female=(0) UKcountryW10=(1)) atmeans saving(file1, replace) 
margins, at(labLookAfterWCW10=(0(1)3) ClassGroup_W10=(2) agegrpW10=(3) female=(0) UKcountryW10=(1)) atmeans saving(file2, replace) 
margins, at(labLookAfterWCW10=(0(1)3) ClassGroup_W10=(3) agegrpW10=(3) female=(0) UKcountryW10=(1)) atmeans saving(file3, replace) 

combomarginsplot file1 file2 file3, labels("White Working Class" "White Graduates" "Ethnic Minorities") ///
										title("{bf: a: Working Class Representation}", size(medsmall) color(black)) ///
										addplot(hist labLookAfterWCW10, ///
                                        blcolor(gs2) fcolor(%20) lc(gs2%10) color(gs2) ///
			                            percent  ///
			                            yaxis(2)   ////
			                            yscale(alt axis(2)) ///
										ytitle("{bf: Distribution of Evaluations of}" "{bf: Labour's Working Class Representation}", axis(2) size(small) orientation(rvertical)) ///
			                            ylabel(0 "0%" 10 "10%" 20 "20%" 30 "30%" 40 "40%" 50 "50%", ///
		                             	labcolor() axis(2) tlcolor(black) tlwidth(thin) labsize(vsmall) angle(0) nogrid) ///
			                            ytitle("{bf: Predicted}" "{bf: Probability}" "{bf: of Labour}" "{bf: Vote Intention}" "{bf:(0-1)}", orientation(horizontal) size(small)) ///
										xtitle("{bf: Evaluation of Labour's Working Class Representation (0-3)}")) ///
										xlabel(0 "0" 1 "1" 2 "2" 3 "3", labsize(small)) ///
										ylabel(0 "0" 0.1 ".1" 0.2 ".2" 0.3 ".3" 0.4 ".4" 0.5 ".5" 0.6 ".6" 0.7 ".7" 0.8 ".8", labsize(small) angle(0) nogrid)  ///
                                        graphregion(color(white)) bgcolor(white) ///
										plot1opts(lcolor(red) mcolor(red)) plot2opts(lcolor(midblue) mcolor(midblue)) plot3opts(lcolor(black) mcolor(black)) ///
										ci1opt(recast(rarea) color(red%66) fintensity(50)) ci2opt(recast(rarea) color(midblue%66) fintensity(50)) ci3opt(color(black) fintensity(0))


* Figure 4b																				
margins, at(labLookAfterBAW10=(0(1)3) ClassGroup_W10=(1) agegrpW10=(3) female=(0) UKcountryW10=(1)) atmeans saving(file1, replace) 
margins, at(labLookAfterBAW10=(0(1)3) ClassGroup_W10=(2) agegrpW10=(3) female=(0) UKcountryW10=(1)) atmeans saving(file2, replace) 
margins, at(labLookAfterBAW10=(0(1)3) ClassGroup_W10=(3) agegrpW10=(3) female=(0) UKcountryW10=(1)) atmeans saving(file3, replace) 

combomarginsplot file1 file2 file3, labels("White Working Class" "White Graduates" "Ethnic Minorities") ///
										title("{bf: b: Black & Asian Representation}", size(medsmall) color(black)) ///
										addplot(hist labLookAfterBAW10, ///
                                        blcolor(gs2) fcolor(%20) lc(gs2%10) color(gs2) ///
			                            percent  ///
			                            yaxis(2)   ////
			                            yscale(alt axis(2)) ///
										ytitle("{bf: Distribution of Evaluations of}" "{bf: Labour's Black/Asian Representation}", axis(2) size(small) orientation(rvertical)) ///
			                            ylabel(0 "0%" 10 "10%" 20 "20%" 30 "30%" 40 "40%" 50 "50%", ///
		                             	labcolor() axis(2) tlcolor(black) tlwidth(thin) labsize(vsmall) angle(0) nogrid) ///
			                            ytitle("{bf: Predicted}" "{bf: Probability}" "{bf: of Labour}" "{bf: Vote Intention}" "{bf:(0-1)}", orientation(horizontal) size(small)) ///
										xtitle("{bf: Evaluation of Labour's Black/Asian Representation (0-3)}")) ///
										xlabel(0 "0" 1 "1" 2 "2" 3 "3", labsize(small)) ///
										ylabel(0 "0" 0.1 ".1" 0.2 ".2" 0.3 ".3" 0.4 ".4" 0.5 ".5" 0.6 ".6" 0.7 ".7" 0.8 ".8", labsize(small) angle(0) nogrid)  ///
                                        graphregion(color(white)) bgcolor(white) ///
										plot1opts(lcolor(red) mcolor(red)) plot2opts(lcolor(midblue) mcolor(midblue)) plot3opts(lcolor(black) mcolor(black)) ///
										ci1opt(recast(rarea) color(red%66) fintensity(50)) ci2opt(recast(rarea) color(midblue%66) fintensity(50)) ci3opt(color(black) fintensity(0))												
										
* Figure 4c																					
margins, at(labLookAfterMCW10=(0(1)3) ClassGroup_W10=(1) agegrpW10=(3) female=(0) UKcountryW10=(1)) atmeans saving(file1, replace) 
margins, at(labLookAfterMCW10=(0(1)3) ClassGroup_W10=(2) agegrpW10=(3) female=(0) UKcountryW10=(1)) atmeans saving(file2, replace) 
margins, at(labLookAfterMCW10=(0(1)3) ClassGroup_W10=(3) agegrpW10=(3) female=(0) UKcountryW10=(1)) atmeans saving(file3, replace) 

combomarginsplot file1 file2 file3, labels("White Working Class" "White Graduates" "Ethnic Minorities") ///
										title("{bf: c: Middle Class Representation}", size(medsmall) color(black)) ///
										addplot(hist labLookAfterMCW10, ///
                                        blcolor(gs2) fcolor(%20) lc(gs2%10) color(gs2) ///
			                            percent  ///
			                            yaxis(2)   ////
			                            yscale(alt axis(2)) ///
										ytitle("{bf: Distribution of Evaluations of}" "{bf: Labour's Middle Class Representation}", axis(2) size(small) orientation(rvertical)) ///
			                            ylabel(0 "0%" 10 "10%" 20 "20%" 30 "30%" 40 "40%" 50 "50%", ///
		                             	labcolor() axis(2) tlcolor(black) tlwidth(thin) labsize(vsmall) angle(0) nogrid) ///
			                            ytitle("{bf: Predicted}" "{bf: Probability}" "{bf: of Labour}" "{bf: Vote Intention}" "{bf:(0-1)}", orientation(horizontal) size(small)) ///
										xtitle("{bf: Evaluation of Labour's Middle Class Representation (0-3)}")) ///
										xlabel(0 "0" 1 "1" 2 "2" 3 "3", labsize(small)) ///
										ylabel(0 "0" 0.1 ".1" 0.2 ".2" 0.3 ".3" 0.4 ".4" 0.5 ".5" 0.6 ".6" 0.7 ".7" 0.8 ".8", labsize(small) angle(0) nogrid)  ///
                                        graphregion(color(white)) bgcolor(white) ///
										plot1opts(lcolor(red) mcolor(red)) plot2opts(lcolor(midblue) mcolor(midblue)) plot3opts(lcolor(black) mcolor(black)) ///
										ci1opt(recast(rarea) color(red%66) fintensity(50)) ci2opt(recast(rarea) color(midblue%66) fintensity(50)) ci3opt(color(black) fintensity(0))

					
										
*****************************************************	

*** TABLE 3 ('The Impact of Evaluations of Labour's Relative Representation of Working Class and Black and Asian People on Support for Labour, by Respondent Class-Ethnicity Group')

* Model A 
svyset [pweight= wt_new_W10], psu(id)
svy: logit voteLabW10 c.labLookAfterBAWvWCW10##i.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10 if ethnocentrismw11 !=. &  lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. 

* Model B
svyset [pweight= wt_new_W10], psu(id)
svy: logit voteLabW10 c.labLookAfterBAWvWCW10##i.ClassGroup_W10 i.agegrpW10  female i.UKcountryW10 ethnocentrismw11 lr_scaleW10_W12 al_scaleW10_W12  

* Model C
svyset [pweight= wt_new_W19_result], psu(id)
svy: logit voteLabW19 c.labLookAfterBAWvWCW19##i.ClassGroup_W19 i.agegrpW19 female i.UKcountryW19 

* Model D
svyset [pweight= wt_new_W13W19], psu(id)
svy: logit voteLabW19 c.labLookAfterBAWvWCW19##i.ClassGroup_W19 i.agegrpW19  female i.UKcountryW19  ethnocentrismw11

* Model E
svyset [pweight= wt_new_W13W19], psu(id)
svy: logit voteLabW19 c.labLookAfterBAWvWCW19##i.ClassGroup_W19 i.agegrpW19  female i.UKcountryW19 voteLabW13  

* Model F
svyset [pweight= wt_new_W13W19], psu(id)
svy: logit voteLabW19 c.labLookAfterBAWvWCW19##i.ClassGroup_W19 i.agegrpW19  female i.UKcountryW19 voteLabW13 ethnocentrismw11


*** FIGURE 5

margins, at(labLookAfterBAWvWCW19=(-3(1)3) ClassGroup_W19=(1) agegrp=(3) female=(0) UKcountryW19=(1) voteLabW13=(1)) atmeans saving(file1, replace) 
margins, at(labLookAfterBAWvWCW19=(-3(1)3) ClassGroup_W19=(2) agegrp=(3) female=(0) UKcountryW19=(1) voteLabW13=(1)) atmeans saving(file2, replace) 
margins, at(labLookAfterBAWvWCW19=(-2(1)3) ClassGroup_W19=(3) agegrp=(3) female=(0) UKcountryW19=(1) voteLabW13=(1)) atmeans saving(file3, replace) 


* Plot below was edited in Graph Editor slightly to get the appearance of the axes right, but you get the idea.
combomarginsplot file1 file2 file3, labels("White Working Class" "White Graduates" "Ethnic Minorities") ///
										title("") ///
										addplot(hist labLookAfterBAWvWCW19, ///
                                        blcolor(gs2) fcolor(%20) lc(gs2%10) color(gs2) ///
			                            percent  ///
			                            yaxis(2)   ////
			                            yscale(alt axis(2)) ///
										ytitle("{bf: Distribution of Evaluations of}" "{bf: Labour's Representation Bias}", axis(2) size(small) orientation(rvertical)) ///
			                            ylabel(0 "0%" 10 "10%" 20 "20%" 30 "30%" 40 "40%" 50 "50%", ///
		                             	labcolor() axis(2) tlcolor(black) tlwidth(thin) labsize(vsmall) angle(0) nogrid) ///
			                            ytitle("{bf: Predicted}" "{bf: Probability}" "{bf: of Loyalty}" "{bf: to Labour,}" "{bf: 2017 - 2019}" "{bf:(0-1)}", orientation(horizontal) size(small)) ///
										xtitle("{bf: Belief about Who Labour Represents Closer: the Working Class or Blacks/Asians}")) ///
										xlabel(-3 -2 -1 0 1 2 3, labsize(small)) ///
										ylabel(0 "0" 0.1 ".1" 0.2 ".2" 0.3 ".3" 0.4 ".4" 0.5 ".5" 0.6 ".6" 0.7 ".7" 0.8 ".8" 0.9 ".9" 1 "1", labsize(small) angle(0) nogrid)  ///
                                        graphregion(color(white)) bgcolor(white) ///
										plot1opts(lcolor(red) mcolor(red)) plot2opts(lcolor(midblue) mcolor(midblue)) plot3opts(lcolor(black) mcolor(black)) ///
										ci1opt(recast(rarea) color(red%66) fintensity(50)) ci2opt(recast(rarea) color(midblue%66) fintensity(50)) ci3opt(color(black) fintensity(0))
										
						
						
						
*******************************************************************************************************************************************


*** SUPPLEMENTARY APPENDIX					


***************************************************

*** APPENDIX 1

* Recode order for purpose of graph
recode ClassGroup_W10 (1 = 4 "White Working Class") (2 = 3 "White Graduates") (3 = 2 "Ethnic Minorities") (4 = 1 "Other Whites") (else=.), gen(classgroupW10)

ssc install vioplot

* Figure A1a
vioplot lr_scaleW10_W12  [aweight=wt_new_W10], horizontal over(classgroupW10) ///
title("{bf: a - Left-Right Economic Value Scale Scores by Class-Ethnicity Group}", span size(small) col(black))  ///
ylab(1 "{bf:Other Whites}" 2 "{bf:Ethnic Minorities}" 3 "{bf:White Graduates}" 4 "{bf: White Working Class}" , labsize(vsmall)) ///
xlab(0 "Most Left" 1 "1" 2 "2" 3 "3" 4 "4" 5 "5" 6 "6" 7 "7" 8 "8" 9 "9" 10 "Most Right", labsize(vsmall)) ///
xtitle("{bf: Left-Right Economic Value Score (0-10)}", orient(horizontal) size(vsmall))  ///
graphregion(color(white)) 

* Figure A1b
vioplot al_scaleW10_W12  [aweight=wt_new_W10], horizontal over(classgroupW10) ///
title("{bf: b - Liberal-Authoritarian Social Value Scale Scores by Class-Ethnicity Group}", span size(small) col(black))  ///
ylab(1 "{bf:Other Whites}" 2 "{bf:Ethnic Minorities}" 3 "{bf:White Graduates}" 4 "{bf: White Working Class}" , labsize(vsmall)) ///
xlab(0 "Most Lib." 1 "1" 2 "2" 3 "3" 4 "4" 5 "5" 6 "6" 7 "7" 8 "8" 9 "9" 10 "Most Auth.", labsize(vsmall)) ///
xtitle("{bf: Liberal-Authoritarian Social Value Score (0-10)}", orient(horizontal) size(vsmall)) ///
graphregion(color(white)) 


* Figure A1c
vioplot ethnocentrismw11 [aweight=wt_new_W11], horizontal over(classgroupW10) ///
title("{bf: c - White Ethnocentrism Scale Scores by Class-Ethnicity Group}", span size(small) col(black))  ///
ylab(1 "{bf:Other Whites}" 2 "{bf:Ethnic Minorities}" 3 "{bf:White Graduates}" 4 "{bf: White Working Class}" , labsize(vsmall)) ///
xlab(-10 "Non-White Ethnocentric"  -5 "-5" 0 "Non-Ethnocentric" 5 "5"  10 "White Ethnocentric.", labsize(vsmall)) ///
xtitle("{bf: White Ethnocentrism Scale Score (-10 to 10)}", orient(horizontal) size(vsmall)) ///
graphregion(color(white)) 


* Figure A1d
vioplot immigSelfW10 [aweight=wt_new_W10], horizontal over(classgroupW10) ///
title("{bf: c - Immigration Preferences by Class-Ethnicity Group}", span size(small) col(black))  ///
ylab(1 "{bf:Other Whites}" 2 "{bf:Ethnic Minorities}" 3 "{bf:White Graduates}" 4 "{bf: White Working Class}" , labsize(vsmall)) ///
xlab(0 "Allow Many Fewer" 1 "1" 2 "2" 3 "3" 4 "4" 5 "5" 6 "6" 7 "7" 8 "8" 9 "9" 10 "Allow Many More", labsize(vsmall)) ///
xtitle("{bf: Immigration Preference Scale (0-10)}", orient(horizontal) size(vsmall))  ///
graphregion(color(white)) 


***************************************************

*** APPENDIX 2

* Figure A2a

* Recode order for purpose of graph
recode labLookAfterWCW10 (3 = 0 "Very Closely") (2 = 1 "Fairly Closely") (1 = 2 "Not Very Closely") (0 = 3 "Not at all Closely") (else=.), gen(LabourWC_W10)
recode labLookAfterBAW10 (3 = 0 "Very Closely") (2 = 1 "Fairly Closely") (1 = 2 "Not Very Closely") (0 = 3 "Not at all Closely") (else=.), gen(LabourBME_W10)
recode labLookAfterMCW10 (3 = 0 "Very Closely") (2 = 1 "Fairly Closely") (1 = 2 "Not Very Closely") (0 = 3 "Not at all Closely") (else=.), gen(LabourMC_W10)


tabplot LabourWC_W10 ClassGroup_W10 [aw=wt_new_W10], percent(ClassGroup_W10) showval  graphregion(color(white))  ///
subtitle('How closely do you think Labour Party looks after the interests of {bf:working class} people?', ///
size(vsmall)) xtitle("") ytitle("{bf: Working Class}" "{bf: Representation}", size(small)) bfcolor(none) ///
ylab(, labsize(vsmall)) ///
xlab(4 "{bf:Other Whites}" 3 "{bf:Ethnic Minorities}" 2 "{bf:White Graduates}" 1 "{bf: White Working Class}" , labsize(vsmall)) ///
saving(WC, replace)

tabplot LabourBME_W10 ClassGroup_W10 [aw=wt_new_W10], percent(ClassGroup_W10) showval  graphregion(color(white))  ///
subtitle('How closely do you think Labour Party looks after the interests of {bf:black and Asian} people?', ///
size(vsmall)) xtitle("") ytitle("{bf: Black and Asian}" "{bf: Representation}", size(small)) bfcolor(none) ///
ylab(, labsize(vsmall)) ///
xlab(4 "{bf:Other Whites}" 3 "{bf:Ethnic Minorities}" 2 "{bf:White Graduates}" 1 "{bf: White Working Class}" , labsize(vsmall)) ///
saving(BME, replace)


tabplot LabourMC_W10 ClassGroup_W10 [aw=wt_new_W10], percent(ClassGroup_W10) showval  graphregion(color(white))  ///
subtitle('How closely do you think Labour Party looks after the interests of {bf:middle class} people?', ///
size(vsmall)) xtitle("") ytitle("{bf: Middle Class}" "{bf: Representation}", size(small)) bfcolor(none) ///
ylab(, labsize(vsmall)) ///
xlab(4 "{bf:Other Whites}" 3 "{bf:Ethnic Minorities}" 2 "{bf:White Graduates}" 1 "{bf: White Working Class}" , labsize(vsmall)) ///
saving(MC, replace)


gr combine WC.gph BME.gph MC.gph, col(1) graphregion(color(white)) ///
title("{bf: a - Perceptions of Labour Representation of Different Groups (November-December 2016)}", span size(small) col(black)) 

	 
* Figure A2b

* Recode order for purpose of graph
recode ClassGroup_W19 (1 = 4 "White Working Class") (2 = 3 "White Graduates") (3 = 2 "Ethnic Minorities") (4 = 1 "Other Whites") (else=.), gen(classgroupW19)

* Recode order for purpose of graph
recode labLookAfterWCW19 (3 = 0 "Very Closely") (2 = 1 "Fairly Closely") (1 = 2 "Not Very Closely") (0 = 3 "Not at all Closely") (else=.), gen(LabourWC_W19)
recode labLookAfterBAW19 (3 = 0 "Very Closely") (2 = 1 "Fairly Closely") (1 = 2 "Not Very Closely") (0 = 3 "Not at all Closely") (else=.), gen(LabourBME_W19)
recode labLookAfterMCW19 (3 = 0 "Very Closely") (2 = 1 "Fairly Closely") (1 = 2 "Not Very Closely") (0 = 3 "Not at all Closely") (else=.), gen(LabourMC_W19)


tabplot LabourWC_W19 ClassGroup_W19 [aw=wt_new_W19_result], percent(ClassGroup_W19) showval  graphregion(color(white))  ///
subtitle('How closely do you think Labour Party looks after the interests of {bf:working class} people?', ///
size(vsmall)) xtitle("") ytitle("{bf: Working Class}" "{bf: Representation}", size(small)) bfcolor(none) ///
ylab(, labsize(vsmall)) ///
xlab(4 "{bf:Other Whites}" 3 "{bf:Ethnic Minorities}" 2 "{bf:White Graduates}" 1 "{bf: White Working Class}" , labsize(vsmall)) ///
saving(WC, replace)

tabplot LabourBME_W19 ClassGroup_W19 [aw=wt_new_W19_result], percent(ClassGroup_W19) showval  graphregion(color(white))  ///
subtitle('How closely do you think Labour Party looks after the interests of {bf:black and Asian} people?', ///
size(vsmall)) xtitle("") ytitle("{bf: Black and Asian}" "{bf: Representation}", size(small)) bfcolor(none) ///
ylab(, labsize(vsmall)) ///
xlab(4 "{bf:Other Whites}" 3 "{bf:Ethnic Minorities}" 2 "{bf:White Graduates}" 1 "{bf: White Working Class}" , labsize(vsmall)) ///
saving(BME, replace)


tabplot LabourMC_W19 ClassGroup_W19 [aw=wt_new_W19_result], percent(ClassGroup_W19) showval  graphregion(color(white))  ///
subtitle('How closely do you think Labour Party looks after the interests of {bf:middle class} people?', ///
size(vsmall)) xtitle("") ytitle("{bf: Middle Class}" "{bf: Representation}", size(small)) bfcolor(none) ///
ylab(, labsize(vsmall)) ///
xlab(4 "{bf:Other Whites}" 3 "{bf:Ethnic Minorities}" 2 "{bf:White Graduates}" 1 "{bf: White Working Class}" , labsize(vsmall)) ///
saving(MC, replace)


gr combine WC.gph BME.gph MC.gph, col(1) graphregion(color(white)) ///
title("{bf: b - Perceptions of Labour Representation of Different Groups (December 2019)}", span size(small) col(black)) 


* Figure A2c

* Recode order for purpose of graph
recode labLookAfterWCW21 (3 = 0 "Very Closely") (2 = 1 "Fairly Closely") (1 = 2 "Not Very Closely") (0 = 3 "Not at all Closely") (else=.), gen(LabourWC_W21)
recode labLookAfterBAW21 (3 = 0 "Very Closely") (2 = 1 "Fairly Closely") (1 = 2 "Not Very Closely") (0 = 3 "Not at all Closely") (else=.), gen(LabourBME_W21)
recode labLookAfterMCW21 (3 = 0 "Very Closely") (2 = 1 "Fairly Closely") (1 = 2 "Not Very Closely") (0 = 3 "Not at all Closely") (else=.), gen(LabourMC_W21)

* Recode order for purpose of graph
tabplot LabourWC_W21 ClassGroup_W21 [aw=wt_new_W21], percent(ClassGroup_W21) showval  graphregion(color(white))  ///
subtitle('How closely do you think Labour Party looks after the interests of {bf:working class} people?', ///
size(vsmall)) xtitle("") ytitle("{bf: Working Class}" "{bf: Representation}", size(small)) bfcolor(none) ///
ylab(, labsize(vsmall)) ///
xlab(4 "{bf:Other Whites}" 3 "{bf:Ethnic Minorities}" 2 "{bf:White Graduates}" 1 "{bf: White Working Class}" , labsize(vsmall)) ///
saving(WC, replace)

tabplot LabourBME_W21 ClassGroup_W21 [aw=wt_new_W21], percent(ClassGroup_W21) showval  graphregion(color(white))  ///
subtitle('How closely do you think Labour Party looks after the interests of {bf:black and Asian} people?', ///
size(vsmall)) xtitle("") ytitle("{bf: Black and Asian}" "{bf: Representation}", size(small)) bfcolor(none) ///
ylab(, labsize(vsmall)) ///
xlab(4 "{bf:Other Whites}" 3 "{bf:Ethnic Minorities}" 2 "{bf:White Graduates}" 1 "{bf: White Working Class}" , labsize(vsmall)) ///
saving(BME, replace)


tabplot LabourMC_W21 ClassGroup_W21 [aw=wt_new_W21], percent(ClassGroup_W21) showval  graphregion(color(white))  ///
subtitle('How closely do you think Labour Party looks after the interests of {bf:middle class} people?', ///
size(vsmall)) xtitle("") ytitle("{bf: Middle Class}" "{bf: Representation}", size(small)) bfcolor(none) ///
ylab(, labsize(vsmall)) ///
xlab(4 "{bf:Other Whites}" 3 "{bf:Ethnic Minorities}" 2 "{bf:White Graduates}" 1 "{bf: White Working Class}" , labsize(vsmall)) ///
saving(MC, replace)


gr combine WC.gph BME.gph MC.gph, col(1) graphregion(color(white)) ///
title("{bf: c - Perceptions of Labour Representation of Different Groups (May 2021)}", span size(small) col(black)) 

	 
	 
***************************************************

*** APPENDIX 3
	 
	
* Figure A3a

tabplot labLookAfterBAWvWCW10 ClassGroup_W10 [aw=wt_new_W10], percent(ClassGroup_W10) showval  graphregion(color(white))  ///
xtitle("") ytitle("", size(small)) bfcolor(none) ///
ylab(, labsize(vsmall)) ///
xlab(4 "{bf:Other Whites}" 3 "{bf:Ethnic Minorities}" 2 "{bf:White Graduates}" 1 "{bf: White Working Class}" , labsize(vsmall)) ///
title("{bf: a - Perceptions of Labour's Relative Representation of Working Class and Black and Asian People (November-December 2016)}", span size(small) col(black))

* Figure A3b

tabplot labLookAfterBAWvWCW19 ClassGroup_W19 [aw=wt_new_W19_result], percent(ClassGroup_W19) showval  graphregion(color(white))  ///
xtitle("") ytitle("", size(small)) bfcolor(none) ///
ylab(, labsize(vsmall)) ///
xlab(4 "{bf:Other Whites}" 3 "{bf:Ethnic Minorities}" 2 "{bf:White Graduates}" 1 "{bf: White Working Class}" , labsize(vsmall)) ///
title("{bf: b - Perceptions of Labour's Relative Representation of Working Class and Black and Asian People (December 2019)}", span size(small) col(black)) 
	 
* Figure A3c

tabplot labLookAfterBAWvWCW21 ClassGroup_W21 [aw=wt_new_W21], percent(ClassGroup_W21) showval  graphregion(color(white))  ///
xtitle("") ytitle("", size(small)) bfcolor(none) ///
ylab(, labsize(vsmall)) ///
xlab(4 "{bf:Other Whites}" 3 "{bf:Ethnic Minorities}" 2 "{bf:White Graduates}" 1 "{bf: White Working Class}" , labsize(vsmall)) ///
title("{bf: c - Perceptions of Labour's Relative Representation of Working Class and Black and Asian People (May 2021)}", span size(small) col(black)) 
	 

***************************************************

*** APPENDIX 4 (see Do-File 1)

***************************************************
	 
*** APPENDIX 5 - 'What can Ethnocentrism Predict?'


** Recode immigration scale so higher = more anti.
recode immigSelfW10 (10 = 0 "Allow Many More") (9 = 1) (8 = 2) (7 = 3) (6 = 4) (5 = 5) (4 = 6) (3 = 7) (2 = 8) (1 = 9) (0 = 10 "Allow Many Fewer"), gen (antiimmigself)

 
 * Models A-C (Ethnocentrism measure can predict 'anti-immigration' sentiment)
svyset [pweight= wt_new_W10], psu(id)
svy: reg antiimmigself             ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10                        if ethnocentrismw11 !=. & lr_scaleW10_W12 !=. & al_scaleW10_W12 !=.
svy: reg antiimmigself             ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10 ethnocentrismw11       if ethnocentrismw11 !=. & lr_scaleW10_W12 !=. & al_scaleW10_W12 !=.
svy: reg antiimmigself             ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10 ethnocentrismw11 lr_scaleW10_W12 al_scaleW10_W12  if ethnocentrismw11 !=. & lr_scaleW10_W12 !=. & al_scaleW10_W12 !=.

 * Models D-F (Ethnocentrism measure can predict 'anti-immigration' sentiment)
svyset [pweight= wt_new_W10], psu(id)
svy: reg EUIntegrationSelfW10     ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10                         if ethnocentrismw11 !=. & lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. 
svy: reg EUIntegrationSelfW10     ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10 ethnocentrismw11        if ethnocentrismw11 !=. & lr_scaleW10_W12 !=. & al_scaleW10_W12 !=.
svy: reg EUIntegrationSelfW10     ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10 ethnocentrismw11 lr_scaleW10_W12 al_scaleW10_W12  if ethnocentrismw11 !=. & lr_scaleW10_W12 !=. & al_scaleW10_W12 !=.


***************************************************
	 
*** APPENDIX 6 - What Predicts Belief that Labour Represents the Working Class? (Table)


svyset [pweight= wt_new_W10], psu(id)

* Model A	
svy: reg labLookAfterWCW10 labLookAfterBAW10 ethnocentrismw11            i.ClassGroup_W10  i.agegrpW10 female i.UKcountryW10   if lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. & labIDstrengthW10 !=.

* Model B	
svy: reg labLookAfterWCW10 c.labLookAfterBAW10##c.ethnocentrismw11       i.ClassGroup_W10  i.agegrpW10 female i.UKcountryW10   if lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. & labIDstrengthW10 !=.
 
* Model C
svy: reg labLookAfterWCW10 c.labLookAfterBAW10##c.ethnocentrismw11       i.ClassGroup_W10  i.agegrpW10 female i.UKcountryW10  lr_scaleW10_W12 al_scaleW10_W12  if labIDstrengthW10 !=.
 
*Model D
svy: reg labLookAfterWCW10 c.labLookAfterBAW10##c.ethnocentrismw11       i.ClassGroup_W10  i.agegrpW10 female i.UKcountryW10  lr_scaleW10_W12 al_scaleW10_W12 i.labIDstrengthW10 


***************************************************
	 
*** APPENDIX 7 - What Predicts Belief that Labour Represents the Working Class? (MarginsPlot)

* Model B
svy: reg labLookAfterWCW10 c.labLookAfterBAW10##c.ethnocentrismw11       i.ClassGroup_W10  i.agegrpW10 female i.UKcountryW10   if lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. & labIDstrengthW10 !=.

margins, at(labLookAfterBAW10=(0(1)3) ethnocentrismw11=(0)      ClassGroup_W10=(1) agegrp=(3) female=(0) UKcountryW10=(1)) atmeans saving(file1, replace) 
margins, at(labLookAfterBAW10=(0(1)3) ethnocentrismw11=(10)     ClassGroup_W10=(1) agegrp=(3) female=(0) UKcountryW10=(1)) atmeans saving(file2, replace) 

combomarginsplot file1 file2, labels("Low White Ethnocentrism" "High White Ethnocentrism")  ///
										title("{bf: Model A: Demographic Controls}", size(medsmall) color(black)) ///
										addplot(hist labLookAfterBAW10, ///
                                        blcolor(gs2) fcolor(%20) lc(gs2%10) color(gs2) ///
			                            percent  ///
			                            yaxis(2)   ////
			                            yscale(alt axis(2)) ///
										ytitle("{bf: Distribution of Evaluations of}" "{bf: Labour's Black/Asian Representation}", axis(2) size(small) orientation(rvertical)) ///
			                            ylabel(0 "0%" 10 "10%" 20 "20%" 30 "30%" 40 "40%" 50 "50%", ///
		                             	labcolor() axis(2) tlcolor(black) tlwidth(thin) labsize(vsmall) angle(0) nogrid) ///
			                            ytitle("{bf: Predicted Evaluation}" "{bf: of Labour's Working}" "{bf: Class Representation}" `"{bf:(0-3)}"', orientation(horizontal)) ///
										xtitle("{bf: Evaluation of Labour's Black/Asian Representation (0-3)}")) ///
										xlabel(0 "0" 1 "1" 2 "2" 3 "3", labsize(small)) ///
										ylabel(1 "1" 1.5 "1.5" 2 "2" 2.5 "2.5", labsize(small) angle(0) nogrid)  ///
                                        graphregion(color(white)) bgcolor(white) ///
										plot1opts(lcolor(blue) mcolor(blue)) plot2opts(lcolor(red) mcolor(red)) ///
										ci1opt(color(blue%66) fintensity(50)) ci2opt(color(red%66) fintensity(50))  ///
										ciopts(recast(rarea))		

* Model D
svy: reg labLookAfterWCW10 c.labLookAfterBAW10##c.ethnocentrismw11       i.ClassGroup_W10  i.agegrpW10 female i.UKcountryW10  lr_scaleW10_W12 al_scaleW10_W12 i.labIDstrengthW10 

margins, at(labLookAfterBAW10=(0(1)3) ethnocentrismw11=(0) ClassGroup_W10=(1) agegrp=(3) female=(0) UKcountryW10=(1) labIDstrengthW10 =(0)) atmeans saving(file1, replace) 
margins, at(labLookAfterBAW10=(0(1)3) ethnocentrismw11=(10) ClassGroup_W10=(1) agegrp=(3) female=(0) UKcountryW10=(1) labIDstrengthW10 =(0)) atmeans saving(file2, replace) 

combomarginsplot file1 file2, labels("Low White Ethnocentrism" "High White Ethnocentrism")  ///
										title("{bf: Model D: Partisan + Left/Right & Lib/Auth Value Controls}", size(medsmall) color(black)) ///
										addplot(hist labLookAfterBAW10, ///
                                        blcolor(gs2) fcolor(%20) lc(gs2%10) color(gs2) ///
			                            percent  ///
			                            yaxis(2)   ////
			                            yscale(alt axis(2)) ///
										ytitle("{bf: Distribution of Evaluations of}" "{bf: Labour's Black/Asian Representation}", axis(2) size(small) orientation(rvertical)) ///
			                            ylabel(0 "0%" 10 "10%" 20 "20%" 30 "30%" 40 "40%" 50 "50%", ///
		                             	labcolor() axis(2) tlcolor(black) tlwidth(thin) labsize(vsmall) angle(0) nogrid) ///
			                            ytitle("{bf: Predicted Evaluation}" "{bf: of Labour's Working}" "{bf: Class Representation}" `"{bf:(0-3)}"', orientation(horizontal)) ///
										xtitle("{bf: Evaluation of Labour's Black/Asian Representation (0-3)}")) ///
										xlabel(0 "0" 1 "1" 2 "2" 3 "3", labsize(small)) ///
										ylabel(1 "1" 1.5 "1.5" 2 "2" 2.5 "2.5", labsize(small) angle(0) nogrid)  ///
                                        graphregion(color(white)) bgcolor(white) ///
										plot1opts(lcolor(blue) mcolor(blue)) plot2opts(lcolor(red) mcolor(red)) ///
										ci1opt(color(blue%66) fintensity(50)) ci2opt(color(red%66) fintensity(50))  ///
										ciopts(recast(rarea))	
  
  
  
***************************************************
	 
*** APPENDIX 8 - The Impact of Ethnocentrism and Evaluations of Labour's Minority, Middle Class and Working Class Representation (Table)


svyset [pweight= wt_new_W10], psu(id)

* Model A
svy:  logit  voteLabW10  i.ClassGroup_W10    i.agegrpW10 female i.UKcountryW10      if lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. & labLookAfterMCW10 !=. & labLookAfterWCW10 !=. & labLookAfterBAW10 !=. & ethnocentrismw11 !=.

* Model B
svy:  logit  voteLabW10  i.ClassGroup_W10  ethnocentrismw11   i.agegrpW10 female i.UKcountryW10      if lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. & labLookAfterMCW10 !=. & labLookAfterWCW10 !=. & labLookAfterBAW10 !=.

* Model C
svy:  logit  voteLabW10  i.ClassGroup_W10   lr_scaleW10_W12 al_scaleW10_W12  i.agegrpW10 female i.UKcountryW10      if lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. & labLookAfterMCW10 !=. & labLookAfterWCW10 !=. & labLookAfterBAW10 !=. & ethnocentrismw11 !=.

* Model D
svy:  logit  voteLabW10  i.ClassGroup_W10   ethnocentrismw11 lr_scaleW10_W12 al_scaleW10_W12  i.agegrpW10 female i.UKcountryW10      if lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. & labLookAfterMCW10 !=. & labLookAfterWCW10 !=. & labLookAfterBAW10 !=. & ethnocentrismw11 !=.

* Model E
svy:  logit  voteLabW10  i.ClassGroup_W10   c.labLookAfterBAW10##c.ethnocentrismw11  i.agegrpW10 female i.UKcountryW10      if lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. & labLookAfterMCW10 !=. & labLookAfterWCW10 !=. & labLookAfterBAW10 !=. & ethnocentrismw11 !=.

* Model F
svy:  logit  voteLabW10  i.ClassGroup_W10   c.labLookAfterBAW10##c.ethnocentrismw11 lr_scaleW10_W12 al_scaleW10_W12 i.agegrpW10 female i.UKcountryW10      if lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. & labLookAfterMCW10 !=. & labLookAfterWCW10 !=. & labLookAfterBAW10 !=. & ethnocentrismw11 !=.

* Model G
svy:  logit  voteLabW10 c.labLookAfterBAW10##c.ethnocentrismw11 c.labLookAfterMCW10##c.ethnocentrismw11 c.labLookAfterWCW10##c.ethnocentrismw11 i.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10  lr_scaleW10_W12 al_scaleW10_W12 


***************************************************
	 
*** APPENDIX 9 - The Impact of Evaluations of Labour's Black & Asian Representation on Support for the Labour Party  (Marginsplot)

* Model F
svy:  logit  voteLabW10  i.ClassGroup_W10   c.labLookAfterBAW10##c.ethnocentrismw11 lr_scaleW10_W12 al_scaleW10_W12 i.agegrpW10 female i.UKcountryW10      if lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. & labLookAfterMCW10 !=. & labLookAfterWCW10 !=. & labLookAfterBAW10 !=. & ethnocentrismw11 !=.
  
margins, at(labLookAfterBAW10=(0(1)3) ethnocentrismw11=(0)  ClassGroup_W10=(1) agegrp=(3) female=(0) UKcountryW10=(1)) atmeans saving(file1, replace) 
margins, at(labLookAfterBAW10=(0(1)3) ethnocentrismw11=(10) ClassGroup_W10=(1) agegrp=(3) female=(0) UKcountryW10=(1)) atmeans saving(file2, replace) 

combomarginsplot file1 file2, labels("Low White Ethnocentrism" "High White Ethnocentrism")  ///
										title("{bf: Model F: Impact of Labour's Black/Asian Representation}", size(medsmall) color(black)) ///
										addplot(hist labLookAfterBAW10, ///
                                        blcolor(gs2) fcolor(%20) lc(gs2%10) color(gs2) ///
			                            percent  ///
			                            yaxis(2)   ////
			                            yscale(alt axis(2)) ///
										ytitle("{bf: Distribution of Evaluations of}" "{bf: Labour's Black/Asian Representation}", axis(2) size(small) orientation(rvertical)) ///
			                            ylabel(0 "0%" 10 "10%" 20 "20%" 30 "30%" 40 "40%" 50 "50%", ///
		                             	labcolor() axis(2) tlcolor(black) tlwidth(thin) labsize(vsmall) angle(0) nogrid) ///
			                            ytitle("{bf: Predicted}" "{bf: Probability}" "{bf: of Labour}" "{bf: Support (0-1)}", orientation(horizontal)) ///
										xtitle("{bf: Evaluation of Labour's Black/Asian Representation (0-3)}")) ///
										xlabel(0 "0" 1 "1" 2 "2" 3 "3", labsize(small)) ///
										ylabel(0 "0" 0.1 ".1" 0.2 ".2" 0.3 ".3" 0.4 ".4" 0.5 ".5" 0.6 ".6" 0.7 ".7" 0.8 ".8", labsize(small) angle(0) nogrid)  ///
                                        graphregion(color(white)) bgcolor(white) ///
										plot1opts(lcolor(blue) mcolor(blue)) plot2opts(lcolor(red) mcolor(red)) ///
										ci1opt(color(blue%66) fintensity(50)) ci2opt(color(red%66) fintensity(50))  ///
										ciopts(recast(rarea))	
											

***************************************************
	 
*** APPENDIX 10 - The Impact of Left-Right, Libertarian-Authoritarian, and White Ethnocentrism on Support for the Labour Party (Dec 2016) (Coefsplot)

* Model F

** Standardising Vars for Graph

svy:  logit  voteLabW10  i.ClassGroup_W10   ethnocentrismw11 lr_scaleW10_W12 al_scaleW10_W12  i.agegrpW10 female i.UKcountryW10      if lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. & labLookAfterMCW10 !=. & labLookAfterWCW10 !=. & labLookAfterBAW10 !=. & ethnocentrismw11 !=.
gen mod2 =e(sample)

 gen std_ethno =.
 sum ethnocentrismw11 if mod2 == 1
 replace std_ethno = (ethnocentrismw11 - r(mean)) / r(sd) if mod2 == 1

 gen std_lr =.
 sum lr_scaleW10_W12 if mod2 == 1
 replace std_lr = (lr_scaleW10_W12 - r(mean)) / r(sd) if mod2 == 1
 
 gen std_al =.
 sum al_scaleW10_W12 if mod2 == 1
 replace std_al = (al_scaleW10_W12 - r(mean)) / r(sd) if mod2 == 1
  
  
  
svy:  logit  voteLabW10  i.ClassGroup_W10   std_ethno std_lr std_al  i.agegrpW10 female i.UKcountryW10      if lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. & labLookAfterMCW10 !=. & labLookAfterWCW10 !=. & labLookAfterBAW10 !=. & ethnocentrismw11 !=., or
estimate store mod1


 coefplot (mod1, label(Model A (White Working Class))), ///
          drop(_cons *.agegrpW10 female *.UKcountryW10  *ClassGroup_W10) eform ///
		  xline(1,  lcolor(black) lwidth(medthick) lpattern(dash)) xlab(0.2(0.2)1.2, nogrid) ///
		  byopts(row(1))
		  
		  
***************************************************
	 
*** APPENDIX 11 - What Predicts White Ethnocentrism in Britain?

svyset [pweight= wt_new_W10], psu(id)

* Model A
svy: reg ethnocentrismw11  ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10 if lr_scaleW10_W12 !=. & al_scaleW10_W12 !=.

* Model B
svy: reg ethnocentrismw11   lr_scaleW10_W12 al_scaleW10_W12 if ClassGroup_W10 !=. & agegrpW10 !=. & female !=. & UKcountryW10 !=.

* Model C
svy: reg ethnocentrismw11  ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10  lr_scaleW10_W12 al_scaleW10_W12 

  
***************************************************
	 
*** APPENDIX 12 - The Impact of Evaluations of Labour's Black and Asian Representation on Evaluations of Labour's Working Class Representation (Immigration Attitudes rather than Ethnocentrism)

svyset [pweight= wt_new_W10], psu(id)	
						
* Model A *		
svy: reg labLookAfterWCW10 c.labLookAfterBAW10##ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10  if immigSelfW10 !=.	& lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. & labIDstrengthW10 !=. 

* Model B *		
svy: reg labLookAfterWCW10 c.labLookAfterBAW10##ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10  immigSelfW10  if lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. & labIDstrengthW10 !=. 

* Model C *		
svy: reg labLookAfterWCW10 c.labLookAfterBAW10##ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10  immigSelfW10 lr_scaleW10_W12 al_scaleW10_W12 i.labIDstrengthW10  


*************************************
		
*** APPENDIX 13 - The Impact of Evaluations of Labour’s Black and Asian (BME), Middle Class (MC), and Working Class (WC) Representation on Support for Labour (Immigration Attitudes rather than Ethnocentrism)

svyset [pweight= wt_new_W10], psu(id)

* Model A *
svy:  logit  voteLabW10 c.labLookAfterBAW10##ib1.ClassGroup_W10 c.labLookAfterMCW10##ib1.ClassGroup_W10 c.labLookAfterWCW10##ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10  if  immigSelfW10 !=.& lr_scaleW10_W12 !=. & al_scaleW10_W12 !=.  

* Model B *
svy:  logit  voteLabW10 c.labLookAfterBAW10##ib1.ClassGroup_W10 c.labLookAfterMCW10##ib1.ClassGroup_W10 c.labLookAfterWCW10##ib1.ClassGroup_W10 i.agegrpW10  female i.UKcountryW10  immigSelfW10 if lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. 

* Model C *
svy:  logit  voteLabW10 c.labLookAfterBAW10##ib1.ClassGroup_W10 c.labLookAfterMCW10##ib1.ClassGroup_W10 c.labLookAfterWCW10##ib1.ClassGroup_W10 i.agegrpW10  female i.UKcountryW10  immigSelfW10 lr_scaleW10_W12 al_scaleW10_W12 

 
 
*************************************
		
*** APPENDIX 14 - The Impact of Evaluations of Labour’s Relative Representation of Ethnic Minorities and the Working Class on Support for Labour (Immigration Attitudes rather than Ethnocentrism)

 
* Model A
svyset [pweight= wt_new_W10], psu(id)
svy: logit voteLabW10 c.labLookAfterBAWvWCW10##i.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10 if immigSelfW10 !=. &  lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. 

* Model B
svyset [pweight= wt_new_W10], psu(id)
svy: logit voteLabW10 c.labLookAfterBAWvWCW10##i.ClassGroup_W10 i.agegrpW10  female i.UKcountryW10 immigSelfW10 lr_scaleW10_W12 al_scaleW10_W12  

* Model C
svyset [pweight= wt_new_W19_result], psu(id)
svy: logit voteLabW19 c.labLookAfterBAWvWCW19##i.ClassGroup_W19 i.agegrpW19 female i.UKcountryW19 

* Model D
svyset [pweight= wt_new_W13W19], psu(id)
svy: logit voteLabW19 c.labLookAfterBAWvWCW19##i.ClassGroup_W19 i.agegrpW19  female i.UKcountryW19  immigSelfW17

* Model E
svyset [pweight= wt_new_W13W19], psu(id)
svy: logit voteLabW19 c.labLookAfterBAWvWCW19##i.ClassGroup_W19 i.agegrpW19  female i.UKcountryW19 voteLabW13 

* Model F
svyset [pweight= wt_new_W13W19], psu(id)
svy: logit voteLabW19 c.labLookAfterBAWvWCW19##i.ClassGroup_W19 i.agegrpW19  female i.UKcountryW19 voteLabW13 immigSelfW17


*************************************
		
*** APPENDIX 15 - The Impact of Evaluations of Labour’s Black and Asian Representation on Evaluations of Labour’s Working Class Representation, With Additional Control for Attitudes to European Union Integration 

svyset [pweight= wt_new_W10], psu(id)

* Model A *		
svy: reg labLookAfterWCW10 c.labLookAfterBAW10##ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10 EUIntegrationSelfW10  if ethnocentrismw11 !=.	& lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. & labIDstrengthW10 !=. 

* Model B *		
svy: reg labLookAfterWCW10 c.labLookAfterBAW10##ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10 ethnocentrismw11 EUIntegrationSelfW10 if lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. & labIDstrengthW10 !=. 

* Model C *		
svy: reg labLookAfterWCW10 c.labLookAfterBAW10##ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10 ethnocentrismw11 lr_scaleW10_W12 al_scaleW10_W12 EUIntegrationSelfW10 i.labIDstrengthW10 
 
 

*************************************
	
*** APPENDIX 16 - The Impact of Evaluations of Labour’s Black and Asian (BME), Middle Class (MC), and Working Class (WC) Representation on Support for Labour,  With Additional Control for Attitudes to European Union Integration  
	
svyset [pweight= wt_new_W10], psu(id)

* Model A
svy:  logit  voteLabW10 c.labLookAfterBAW10##ib1.ClassGroup_W10 c.labLookAfterMCW10##ib1.ClassGroup_W10 c.labLookAfterWCW10##ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10 EUIntegrationSelfW10  if ethnocentrismw11 !=.& lr_scaleW10_W12 !=. & al_scaleW10_W12 !=.  

* Model B
svy:  logit  voteLabW10 c.labLookAfterBAW10##ib1.ClassGroup_W10 c.labLookAfterMCW10##ib1.ClassGroup_W10 c.labLookAfterWCW10##ib1.ClassGroup_W10 i.agegrpW10  female i.UKcountryW10 ethnocentrismw11 EUIntegrationSelfW10 if lr_scaleW10_W12 !=. & al_scaleW10_W12 !=.

* Model C
svy:  logit  voteLabW10 c.labLookAfterBAW10##ib1.ClassGroup_W10 c.labLookAfterMCW10##ib1.ClassGroup_W10 c.labLookAfterWCW10##ib1.ClassGroup_W10 i.agegrpW10  female i.UKcountryW10 ethnocentrismw11 lr_scaleW10_W12 al_scaleW10_W12 EUIntegrationSelfW10
 
 

*************************************

*** APPENDIX 17 - The Impact of Evaluations of Labour’s Relative Representation of Ethnic Minorities and the Working Class on Support for Labour with Additional Control for Attitudes to European Union Integration 
 
 * Model A
svyset [pweight= wt_new_W10], psu(id)
svy: logit voteLabW10 c.labLookAfterBAWvWCW10##i.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10 EUIntegrationSelfW10 if ethnocentrismw11 !=. &  lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. 

* Model B
svyset [pweight= wt_new_W10], psu(id)
svy: logit voteLabW10 c.labLookAfterBAWvWCW10##i.ClassGroup_W10 i.agegrpW10  female i.UKcountryW10 EUIntegrationSelfW10 ethnocentrismw11 lr_scaleW10_W12 al_scaleW10_W12  

* Model C
svyset [pweight= wt_new_W19_result], psu(id)
svy: logit voteLabW19 c.labLookAfterBAWvWCW19##i.ClassGroup_W19 i.agegrpW19 female i.UKcountryW19 EUIntegrationSelfW19

* Model D
svyset [pweight= wt_new_W13W19], psu(id)
svy: logit voteLabW19 c.labLookAfterBAWvWCW19##i.ClassGroup_W19 i.agegrpW19  female i.UKcountryW19  ethnocentrismw11 EUIntegrationSelfW19

* Model E
svyset [pweight= wt_new_W13W19], psu(id)
svy: logit voteLabW19 c.labLookAfterBAWvWCW19##i.ClassGroup_W19 i.agegrpW19  female i.UKcountryW19 voteLabW13 EUIntegrationSelfW19

* Model F
svyset [pweight= wt_new_W13W19], psu(id)
svy: logit voteLabW19 c.labLookAfterBAWvWCW19##i.ClassGroup_W19 i.agegrpW19  female i.UKcountryW19 voteLabW13 ethnocentrismw11  EUIntegrationSelfW19

 

**************************************

* APPENDIX 18 - The Impact of Evaluations of Labour’s Black and Asian (BME), Middle Class (MC), and Working Class (WC) Representation on Support for Labour -   Sample Restricted to Whites with a Working Class Identity 
	
svyset [pweight= wt_new_W10], psu(id)

* Model A
svy:  logit  voteLabW10 labLookAfterBAW10 labLookAfterMCW10 labLookAfterWCW10 i.agegrpW10 female i.UKcountryW10  if racialclassidentity_W10 == 1 & ethnocentrismw11 !=.& lr_scaleW10_W12 !=. & al_scaleW10_W12 !=.  

* Model B
svy:  logit  voteLabW10 labLookAfterBAW10 labLookAfterMCW10 labLookAfterWCW10 i.agegrpW10  female i.UKcountryW10 ethnocentrismw11 if racialclassidentity_W10 == 1 & lr_scaleW10_W12 !=. & al_scaleW10_W12 !=.

* Model C
svy:  logit  voteLabW10 labLookAfterBAW10 labLookAfterMCW10 labLookAfterWCW10 i.agegrpW10  female i.UKcountryW10 ethnocentrismw11 lr_scaleW10_W12 al_scaleW10_W12 if racialclassidentity_W10 == 1 

									
   
 ***************************************

* APPENDIX 19 - The Impact of Evaluations of Labour’s Relative Representation of Ethnic Minorities and the Working Class on Support for Labour – Sample Restricted to Whites with a Working Class Identity 
 

* Model A
svyset [pweight= wt_new_W10], psu(id)
svy: logit voteLabW10 labLookAfterBAWvWCW10 i.agegrpW10 female i.UKcountryW10 if ethnocentrismw11 !=. &  lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. &  racialclassidentity_W19 == 1 

* Model B
svyset [pweight= wt_new_W10], psu(id)
svy: logit voteLabW10 labLookAfterBAWvWCW10 i.agegrpW10  female i.UKcountryW10 ethnocentrismw11 lr_scaleW10_W12 al_scaleW10_W12   if racialclassidentity_W19 == 1 

* Model C
svyset [pweight= wt_new_W19_result], psu(id)
svy: logit voteLabW19 labLookAfterBAWvWCW19 i.agegrpW19 female i.UKcountryW19   if racialclassidentity_W19 == 1 

* Model D
svyset [pweight= wt_new_W13W19], psu(id)
svy: logit voteLabW19 labLookAfterBAWvWCW19 i.agegrpW19  female i.UKcountryW19  ethnocentrismw11  if racialclassidentity_W19 == 1 

* Model E
svyset [pweight= wt_new_W13W19], psu(id)
svy: logit voteLabW19 labLookAfterBAWvWCW19 i.agegrpW19  female i.UKcountryW19 voteLabW13    if racialclassidentity_W19 == 1 

* Model F
svyset [pweight= wt_new_W13W19], psu(id)
svy: logit voteLabW19 labLookAfterBAWvWCW19 i.agegrpW19  female i.UKcountryW19 voteLabW13 ethnocentrismw11  if racialclassidentity_W19 == 1 


 ***************************************

* APPENDIX 20 - The Impact of Evaluations of Labour’s Black and Asian Representation on Evaluations of Labour’s Working Class Representation - Additional Controls for Trade Union Membership and Religion 
  
svyset [pweight= wt_new_W10], psu(id)	
						
* Model A *		
svy: reg labLookAfterWCW10 c.labLookAfterBAW10##ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10  i.TUmemW2W17 i.religionW10 if ethnocentrismw11 !=.	& lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. & labIDstrengthW10 !=. 

* Model B *		
svy: reg labLookAfterWCW10 c.labLookAfterBAW10##ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10 ethnocentrismw11  i.TUmemW2W17 i.religionW10 if lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. & labIDstrengthW10 !=. 

* Model C *		
svy: reg labLookAfterWCW10 c.labLookAfterBAW10##ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10 ethnocentrismw11 lr_scaleW10_W12 al_scaleW10_W12 i.labIDstrengthW10  i.TUmemW2W17 i.religionW10


*************************************
		
* APPENDIX 21 - The Impact of Evaluations of Labour’s Black and Asian (BME), Middle Class (MC), and Working Class (WC) Representation on Support for Labour - Additional Controls for Trade Union Membership and Religion 
	
svyset [pweight= wt_new_W10], psu(id)

* Model A
svy:  logit  voteLabW10 c.labLookAfterBAW10##ib1.ClassGroup_W10 c.labLookAfterMCW10##ib1.ClassGroup_W10 c.labLookAfterWCW10##ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10  i.TUmemW2W17 i.religionW10 if ethnocentrismw11 !=.& lr_scaleW10_W12 !=. & al_scaleW10_W12 !=.  

* Model B
svy:  logit  voteLabW10 c.labLookAfterBAW10##ib1.ClassGroup_W10 c.labLookAfterMCW10##ib1.ClassGroup_W10 c.labLookAfterWCW10##ib1.ClassGroup_W10 i.agegrpW10  female i.UKcountryW10 ethnocentrismw11  i.TUmemW2W17 i.religionW10 if lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. 

* Model C
svy:  logit  voteLabW10 c.labLookAfterBAW10##ib1.ClassGroup_W10 c.labLookAfterMCW10##ib1.ClassGroup_W10 c.labLookAfterWCW10##ib1.ClassGroup_W10 i.agegrpW10  female i.UKcountryW10 ethnocentrismw11 lr_scaleW10_W12 al_scaleW10_W12  i.TUmemW2W17 i.religionW10

 
 
*************************************
 
* APPENDIX 22 - The Impact of Evaluations of Labour’s Relative Representation of Ethnic Minorities and the Working Class on Support for Labour - Additional Controls for Trade Union Membership and Religion 
 
* Model A
svyset [pweight= wt_new_W10], psu(id)
svy: logit voteLabW10 c.labLookAfterBAWvWCW10##i.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10 i.TUmemW2W17 i.religionW10 if ethnocentrismw11 !=. &  lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. 

* Model B
svyset [pweight= wt_new_W10], psu(id)
svy: logit voteLabW10 c.labLookAfterBAWvWCW10##i.ClassGroup_W10 i.agegrpW10  female i.UKcountryW10 ethnocentrismw11 lr_scaleW10_W12 al_scaleW10_W12  i.TUmemW2W17 i.religionW10

* Model C
svyset [pweight= wt_new_W19_result], psu(id)
svy: logit voteLabW19 c.labLookAfterBAWvWCW19##i.ClassGroup_W19 i.agegrpW19 female i.UKcountryW19 i.TUmemW19W20 i.religionW19

* Model D
svyset [pweight= wt_new_W13W19], psu(id)
svy: logit voteLabW19 c.labLookAfterBAWvWCW19##i.ClassGroup_W19 i.agegrpW19  female i.UKcountryW19  ethnocentrismw11 i.TUmemW19W20 i.religionW19

* Model E
svyset [pweight= wt_new_W13W19], psu(id)
svy: logit voteLabW19 c.labLookAfterBAWvWCW19##i.ClassGroup_W19 i.agegrpW19  female i.UKcountryW19 voteLabW13   i.TUmemW19W20 i.religionW19

* Model F
svyset [pweight= wt_new_W13W19], psu(id)
svy: logit voteLabW19 c.labLookAfterBAWvWCW19##i.ClassGroup_W19 i.agegrpW19  female i.UKcountryW19 voteLabW13 ethnocentrismw11 i.TUmemW19W20 i.religionW19


 *************************************
 
* APPENDIX 23 - Descriptive Statistics - NA
 
 
 *************************************
 
 * APPENDIX 24 - See do-file 2

 *************************************

 * APPENDIX 25 - What Predicts Belief that Labour Represents Black and Asians Better than the Working Class? 

 * Model A (Wave 10) *
svyset [pweight= wt_new_W10], psu(id)
svy: reg labLookAfterBAWvWCW10  ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10  
svy: reg labLookAfterBAWvWCW10  ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10  ethnocentrismw11 lr_scaleW10_W12 al_scaleW10_W12 

* Model B (Wave 19) *
svyset [pweight= wt_new_W19_result], psu(id)
svy: reg labLookAfterBAWvWCW19 ib1.ClassGroup_W19 i.agegrpW19 female i.UKcountryW19  
svy: reg labLookAfterBAWvWCW19 ib1.ClassGroup_W19 i.agegrpW19 female i.UKcountryW19  ethnocentrismw11 
 
* Model C (Wave 21) *
svyset [pweight= wt_new_W21], psu(id)
svy: reg labLookAfterBAWvWCW21 ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10  
svy: reg labLookAfterBAWvWCW21 ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10  al_scaleW21 lr_scaleW21
  
 
 *************************************
 
 * APPENDIX 26 and APPENDIX 27 - The Impact of Evaluations of Labour’s Middle Class Representation on Evaluations of Labour’s Working Class Representation (Table + Figures)
	
svyset [pweight= wt_new_W10], psu(id)

* Model A *		
svy: reg labLookAfterWCW10 c.labLookAfterMCW10##ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10   if ethnocentrismw11 !=.	& lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. & labIDstrengthW10 !=.

margins, at(labLookAfterMCW10=(0(1)3) ClassGroup_W10=(1) agegrpW10=(3) female=(0) UKcountryW10=(1)) atmeans saving(file1, replace) 
margins, at(labLookAfterMCW10=(0(1)3) ClassGroup_W10=(2) agegrpW10=(3) female=(0) UKcountryW10=(1)) atmeans saving(file2, replace) 
margins, at(labLookAfterMCW10=(0(1)3) ClassGroup_W10=(3) agegrpW10=(3) female=(0) UKcountryW10=(1)) atmeans saving(file3, replace) 

combomarginsplot file1 file2 file3, labels("White Working Class" "White Graduates" "Ethnic Minorities") ///
										title("{bf: Model A: Demographic Controls}", size(medsmall) color(black)) ///
										addplot(hist labLookAfterMCW10, ///
                                        blcolor(gs2) fcolor(%20) lc(gs2%10) color(gs2) ///
			                            percent  ///
			                            yaxis(2)   ////
			                            yscale(alt axis(2)) ///
										ytitle("{bf: Distribution of Evaluations of}" "{bf: Labour's Middle Class Representation}", axis(2) size(small) orientation(rvertical)) ///
			                            ylabel(0 "0%" 10 "10%" 20 "20%" 30 "30%" 40 "40%" 50 "50%", ///
		                             	labcolor() axis(2) tlcolor(black) tlwidth(thin) labsize(vsmall) angle(0) nogrid) ///
			                            ytitle("{bf: Predicted Evaluation}" "{bf: of Labour's Working}" "{bf: Class Representation}" `"{bf:(0-3)}"', orientation(horizontal)) ///
										xtitle("{bf: Evaluation of Labour's Middle Class Representation (0-3)}")) ///
										xlabel(0 "0" 1 "1" 2 "2" 3 "3", labsize(small)) ///
										ylabel(1 "1" 1.5 "1.5" 2 "2" 2.5 "2.5", labsize(small) angle(0) nogrid)  ///
                                        graphregion(color(white)) bgcolor(white) ///
										plot1opts(lcolor(red) mcolor(red)) plot2opts(lcolor(midblue) mcolor(midblue)) plot3opts(lcolor(black) mcolor(black)) ///
										ci1opt(recast(rarea) color(red%66) fintensity(50)) ci2opt(recast(rarea) color(midblue%66) fintensity(50)) ci3opt(color(black) fintensity(0))
												
										
* Model B *		
svy: reg labLookAfterWCW10 c.labLookAfterMCW10##ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10 ethnocentrismw11 if lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. & labIDstrengthW10 !=.

margins, at(labLookAfterMCW10=(0(1)3) ClassGroup_W10=(1) agegrpW10=(3) female=(0) UKcountryW10=(1)) atmeans saving(file1, replace) 
margins, at(labLookAfterMCW10=(0(1)3) ClassGroup_W10=(2) agegrpW10=(3) female=(0) UKcountryW10=(1)) atmeans saving(file2, replace) 
margins, at(labLookAfterMCW10=(0(1)3) ClassGroup_W10=(3) agegrpW10=(3) female=(0) UKcountryW10=(1)) atmeans saving(file3, replace) 

combomarginsplot file1 file2 file3, labels("White Working Class" "White Graduates" "Ethnic Minorities") ///
										title("{bf: Model B: + Ethnocentrism Control}", size(medsmall) color(black)) ///
										addplot(hist labLookAfterMCW10, ///
                                        blcolor(gs2) fcolor(%20) lc(gs2%10) color(gs2) ///
			                            percent  ///
			                            yaxis(2)   ////
			                            yscale(alt axis(2)) ///
										ytitle("{bf: Distribution of Evaluations of}" "{bf: Labour's Middle Class Representation}", axis(2) size(small) orientation(rvertical)) ///
			                            ylabel(0 "0%" 10 "10%" 20 "20%" 30 "30%" 40 "40%" 50 "50%", ///
		                             	labcolor() axis(2) tlcolor(black) tlwidth(thin) labsize(vsmall) angle(0) nogrid) ///
			                            ytitle("{bf: Predicted Evaluation}" "{bf: of Labour's Working}" "{bf: Class Representation}" `"{bf:(0-3)}"', orientation(horizontal)) ///
										xtitle("{bf: Evaluation of Labour's Middle Class Representation (0-3)}")) ///
										xlabel(0 "0" 1 "1" 2 "2" 3 "3", labsize(small)) ///
										ylabel(1 "1" 1.5 "1.5" 2 "2" 2.5 "2.5", labsize(small) angle(0) nogrid)  ///
                                        graphregion(color(white)) bgcolor(white) ///
										plot1opts(lcolor(red) mcolor(red)) plot2opts(lcolor(midblue) mcolor(midblue)) plot3opts(lcolor(black) mcolor(black)) ///
										ci1opt(recast(rarea) color(red%66) fintensity(50)) ci2opt(recast(rarea) color(midblue%66) fintensity(50)) ci3opt(color(black) fintensity(0))
										
										
* Model C *		
svy: reg labLookAfterWCW10 c.labLookAfterMCW10##ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10 ethnocentrismw11 lr_scaleW10_W12 al_scaleW10_W12 if labIDstrengthW10 !=.

margins, at(labLookAfterMCW10=(0(1)3) ClassGroup_W10=(1) agegrpW10=(3) female=(0) UKcountryW10=(1)) atmeans saving(file1, replace) 
margins, at(labLookAfterMCW10=(0(1)3) ClassGroup_W10=(2) agegrpW10=(3) female=(0) UKcountryW10=(1)) atmeans saving(file2, replace) 
margins, at(labLookAfterMCW10=(0(1)3) ClassGroup_W10=(3) agegrpW10=(3) female=(0) UKcountryW10=(1)) atmeans saving(file3, replace) 

combomarginsplot file1 file2 file3, labels("White Working Class" "White Graduates" "Ethnic Minorities") ///
										title("{bf: Model C: + Left-Right & Lib-Auth Values Controls}", size(medsmall) color(black)) ///
										addplot(hist labLookAfterMCW10, ///
                                        blcolor(gs2) fcolor(%20) lc(gs2%10) color(gs2) ///
			                            percent  ///
			                            yaxis(2)   ////
			                            yscale(alt axis(2)) ///
										ytitle("{bf: Distribution of Evaluations of}" "{bf: Labour's Middle Class Representation}", axis(2) size(small) orientation(rvertical)) ///
			                            ylabel(0 "0%" 10 "10%" 20 "20%" 30 "30%" 40 "40%" 50 "50%", ///
		                             	labcolor() axis(2) tlcolor(black) tlwidth(thin) labsize(vsmall) angle(0) nogrid) ///
			                            ytitle("{bf: Predicted Evaluation}" "{bf: of Labour's Working}" "{bf: Class Representation}" `"{bf:(0-3)}"', orientation(horizontal)) ///
										xtitle("{bf: Evaluation of Labour's Middle Class Representation (0-3)}")) ///
										xlabel(0 "0" 1 "1" 2 "2" 3 "3", labsize(small)) ///
										ylabel(1 "1" 1.5 "1.5" 2 "2" 2.5 "2.5", labsize(small) angle(0) nogrid)  ///
                                        graphregion(color(white)) bgcolor(white) ///
										plot1opts(lcolor(red) mcolor(red)) plot2opts(lcolor(midblue) mcolor(midblue)) plot3opts(lcolor(black) mcolor(black)) ///
										ci1opt(recast(rarea) color(red%66) fintensity(50)) ci2opt(recast(rarea) color(midblue%66) fintensity(50)) ci3opt(color(black) fintensity(0))
										

* Model D *		
svy: reg labLookAfterWCW10 c.labLookAfterMCW10##ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10 ethnocentrismw11 lr_scaleW10_W12 al_scaleW10_W12 i.labIDstrengthW10 

margins, at(labLookAfterMCW10=(0(1)3) ClassGroup_W10=(1) agegrpW10=(3) female=(0) UKcountryW10=(1) labIDstrengthW10=(0)) atmeans saving(file1, replace) 
margins, at(labLookAfterMCW10=(0(1)3) ClassGroup_W10=(2) agegrpW10=(3) female=(0) UKcountryW10=(1) labIDstrengthW10=(0)) atmeans saving(file2, replace) 
margins, at(labLookAfterMCW10=(0(1)3) ClassGroup_W10=(3) agegrpW10=(3) female=(0) UKcountryW10=(1) labIDstrengthW10=(0)) atmeans saving(file3, replace) 

combomarginsplot file1 file2 file3, labels("White Working Class" "White Graduates" "Ethnic Minorities") ///
										title("{bf: Model D: + Strength Labour Partisanship Control}", size(medsmall) color(black)) ///
										addplot(hist labLookAfterMCW10, ///
                                        blcolor(gs2) fcolor(%20) lc(gs2%10) color(gs2) ///
			                            percent  ///
			                            yaxis(2)   ////
			                            yscale(alt axis(2)) ///
										ytitle("{bf: Distribution of Evaluations of}" "{bf: Labour's Middle Class Representation}", axis(2) size(small) orientation(rvertical)) ///
			                            ylabel(0 "0%" 10 "10%" 20 "20%" 30 "30%" 40 "40%" 50 "50%", ///
		                             	labcolor() axis(2) tlcolor(black) tlwidth(thin) labsize(vsmall) angle(0) nogrid) ///
			                            ytitle("{bf: Predicted Evaluation}" "{bf: of Labour's Working}" "{bf: Class Representation}" `"{bf:(0-3)}"', orientation(horizontal)) ///
										xtitle("{bf: Evaluation of Labour's Middle Class Representation (0-3)}")) ///
										xlabel(0 "0" 1 "1" 2 "2" 3 "3", labsize(small)) ///
										ylabel(1 "1" 1.5 "1.5" 2 "2" 2.5 "2.5", labsize(small) angle(0) nogrid)  ///
                                        graphregion(color(white)) bgcolor(white) ///
										plot1opts(lcolor(red) mcolor(red)) plot2opts(lcolor(midblue) mcolor(midblue)) plot3opts(lcolor(black) mcolor(black)) ///
										ci1opt(recast(rarea) color(red%66) fintensity(50)) ci2opt(recast(rarea) color(midblue%66) fintensity(50)) ci3opt(color(black) fintensity(0))
													

 *************************************
 
 * APPENDIX 28 - The Impact of Evaluations of Labour’s Black and Asian (BME), Middle Class (MC), and Working Class (WC) Representation on Support for Labour,  With Non-Voters Included as Non-Lab Supporters
	
	
svyset [pweight= wt_new_W10], psu(id)

* Model A
svy:  logit  voteLabW10ALT c.labLookAfterBAW10##ib1.ClassGroup_W10 c.labLookAfterMCW10##ib1.ClassGroup_W10 c.labLookAfterWCW10##ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10   if ethnocentrismw11 !=.& lr_scaleW10_W12 !=. & al_scaleW10_W12 !=.  

* Model B
svy:  logit  voteLabW10ALT c.labLookAfterBAW10##ib1.ClassGroup_W10 c.labLookAfterMCW10##ib1.ClassGroup_W10 c.labLookAfterWCW10##ib1.ClassGroup_W10 i.agegrpW10  female i.UKcountryW10 ethnocentrismw11 if lr_scaleW10_W12 !=. & al_scaleW10_W12 !=.

* Model C
svy:  logit  voteLabW10ALT c.labLookAfterBAW10##ib1.ClassGroup_W10 c.labLookAfterMCW10##ib1.ClassGroup_W10 c.labLookAfterWCW10##ib1.ClassGroup_W10 i.agegrpW10  female i.UKcountryW10 ethnocentrismw11 lr_scaleW10_W12 al_scaleW10_W12 
 												
													
 *************************************
 
 * APPENDIX 29 - The Impact of Evaluations of Labour’s Black and Asian (BME), Middle Class (MC), and Working Class (WC) Representation on Support for Labour,  With Subjective Propensity to Vote Labour   (0-10) as an Alternative Dependent Variable 
	
	
svyset [pweight= wt_new_W10], psu(id)

* Model A
svy:  reg ptvLabW10  c.labLookAfterBAW10##ib1.ClassGroup_W10 c.labLookAfterMCW10##ib1.ClassGroup_W10 c.labLookAfterWCW10##ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10 if ethnocentrismw11 !=.& lr_scaleW10_W12 !=. & al_scaleW10_W12 !=.  

* Model B
svy:  reg ptvLabW10  c.labLookAfterBAW10##ib1.ClassGroup_W10 c.labLookAfterMCW10##ib1.ClassGroup_W10 c.labLookAfterWCW10##ib1.ClassGroup_W10 i.agegrpW10  female i.UKcountryW10 ethnocentrismw11 if lr_scaleW10_W12 !=. & al_scaleW10_W12 !=.

* Model C
svy:  reg ptvLabW10  c.labLookAfterBAW10##ib1.ClassGroup_W10 c.labLookAfterMCW10##ib1.ClassGroup_W10 c.labLookAfterWCW10##ib1.ClassGroup_W10 i.agegrpW10  female i.UKcountryW10 ethnocentrismw11 lr_scaleW10_W12 al_scaleW10_W12 
 
 									
 *************************************
 
 * APPENDIX 30 - The Impact of Evaluations of Labour’s Black and Asian (BME), Middle Class (MC), and Working Class (WC) Representation on Support for Labour.  Sample Restricted to ‘Potential Labour Voters’ (PTV Labour > 0/10)  
	
	
svyset [pweight= wt_new_W10], psu(id)

* Model A
svy:  logit  voteLabW10 c.labLookAfterBAW10##ib1.ClassGroup_W10 c.labLookAfterMCW10##ib1.ClassGroup_W10 c.labLookAfterWCW10##ib1.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10  if ethnocentrismw11 !=.& lr_scaleW10_W12 !=. & al_scaleW10_W12 !=.   & inrange(ptvLabW10,1,10)

* Model B
svy:  logit  voteLabW10 c.labLookAfterBAW10##ib1.ClassGroup_W10 c.labLookAfterMCW10##ib1.ClassGroup_W10 c.labLookAfterWCW10##ib1.ClassGroup_W10 i.agegrpW10  female i.UKcountryW10 ethnocentrismw11 if lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. & inrange(ptvLabW10,1,10)

* Model C
svy:  logit  voteLabW10 c.labLookAfterBAW10##ib1.ClassGroup_W10 c.labLookAfterMCW10##ib1.ClassGroup_W10 c.labLookAfterWCW10##ib1.ClassGroup_W10 i.agegrpW10  female i.UKcountryW10 ethnocentrismw11 lr_scaleW10_W12 al_scaleW10_W12 if inrange(ptvLabW10,1,10)

 		
 *************************************
 
 * APPENDIX 31 - The Impact of Evaluations of Labour’s Relative Representation of Ethnic Minorities and the Working Class on Support for Labour – Additional Control for Absolute Ratings of Labour’s Minority and Working Class Representation 
	
 
gen labWCandBME_W10 = labLookAfterBAW10 + labLookAfterWCW10
gen labWCandBME_W19 = labLookAfterBAW19 + labLookAfterWCW19
 
* Model A
svyset [pweight= wt_new_W10], psu(id)
svy: logit voteLabW10 c.labLookAfterBAWvWCW10##i.ClassGroup_W10 labWCandBME_W10 i.agegrpW10 female i.UKcountryW10 if ethnocentrismw11 !=. &  lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. 

* Model B
svyset [pweight= wt_new_W10], psu(id)
svy: logit voteLabW10 c.labLookAfterBAWvWCW10##i.ClassGroup_W10 labWCandBME_W10 i.agegrpW10  female i.UKcountryW10 ethnocentrismw11 lr_scaleW10_W12 al_scaleW10_W12 

* Model C
svyset [pweight= wt_new_W19_result], psu(id)
svy: logit voteLabW19 c.labLookAfterBAWvWCW19##i.ClassGroup_W19 labWCandBME_W19 i.agegrpW19 female i.UKcountryW19 

* Model D
svyset [pweight= wt_new_W13W19], psu(id)
svy: logit voteLabW19 c.labLookAfterBAWvWCW19##i.ClassGroup_W19 labWCandBME_W19 i.agegrpW19  female i.UKcountryW19 ethnocentrismw11

* Model E
svyset [pweight= wt_new_W13W19], psu(id)
svy: logit voteLabW19 c.labLookAfterBAWvWCW19##i.ClassGroup_W19 labWCandBME_W19 i.agegrpW19  female i.UKcountryW19 voteLabW13  

* Model F
svyset [pweight= wt_new_W13W19], psu(id)
svy: logit voteLabW19 c.labLookAfterBAWvWCW19##i.ClassGroup_W19 labWCandBME_W19 i.agegrpW19  female i.UKcountryW19 voteLabW13 ethnocentrismw11


 *************************************
 
 * APPENDIX 32 - The Impact of Evaluations of Labour’s Relative Representation of Ethnic Minorities and the Working Class on Support for Labour, With Non-Voters Included 
	
  
* Model A
svyset [pweight= wt_new_W10], psu(id)
svy: logit voteLabW10ALT c.labLookAfterBAWvWCW10##i.ClassGroup_W10 i.agegrpW10 female i.UKcountryW10 if ethnocentrismw11 !=. &  lr_scaleW10_W12 !=. & al_scaleW10_W12 !=. 

* Model B
svyset [pweight= wt_new_W10], psu(id)
svy: logit voteLabW10ALT c.labLookAfterBAWvWCW10##i.ClassGroup_W10 i.agegrpW10  female i.UKcountryW10 ethnocentrismw11 lr_scaleW10_W12 al_scaleW10_W12  

* Model C
svyset [pweight= wt_new_W19_result], psu(id)
svy: logit voteLabW19ALT c.labLookAfterBAWvWCW19##i.ClassGroup_W19 i.agegrpW19 female i.UKcountryW19 

* Model D
svyset [pweight= wt_new_W13W19], psu(id)
svy: logit voteLabW19ALT c.labLookAfterBAWvWCW19##i.ClassGroup_W19 i.agegrpW19  female i.UKcountryW19  ethnocentrismw11 

* Model E
svyset [pweight= wt_new_W13W19], psu(id)
svy: logit voteLabW19ALT c.labLookAfterBAWvWCW19##i.ClassGroup_W19 i.agegrpW19  female i.UKcountryW19 voteLabW13ALT 

* Model F
svyset [pweight= wt_new_W13W19], psu(id)
svy: logit voteLabW19ALT c.labLookAfterBAWvWCW19##i.ClassGroup_W19 i.agegrpW19  female i.UKcountryW19 voteLabW13ALT ethnocentrismw11  

 
 
  *************************************
 
 * APPENDIX 33 - The Impact of Evaluations of Labour’s Relative Representation of Ethnic Minorities and the Working Class on the Defection of White Working Class Supporters from Labour 2017-19. Sample Restricted to White WC 2017 Labour Voters 
	
 	
 recode voteW19 (2 = 1 "Loyalty to Labour") (1 = 2 "Defect: Cons") (6 = 3 "Defect: UKIP/BP") (3/5 = 4 "Defect: Libs/Greens/Nats") (7 = 4) (9=6 "Defect: Other") (0 = 5 "Defect: Abstain") (else=.), gen(direction_17to19)
 
svyset [pweight= wt_new_W13W19], psu(id)
svy: mlogit direction_17to19 labLookAfterBAWvWCW19 i.agegrpW19 female i.UKcountryW19  if voteLabW13 == 1 & ClassGroup_W19 == 1, base(1) 

svyset [pweight= wt_new_W13W19], psu(id)
svy: mlogit direction_17to19 labLookAfterBAWvWCW19 i.agegrpW19 female i.UKcountryW19 ethnocentrismw11 if voteLabW13 == 1 & ClassGroup_W19 == 1, base(1)

 
 